diff options
author | vishwa <vishwanath@in.ibm.com> | 2016-05-30 02:25:21 -0500 |
---|---|---|
committer | Patrick Williams <patrick@stwcx.xyz> | 2016-06-06 11:34:31 -0500 |
commit | 2f5a3cfd2412c7e10d128a856ad2c37c8a1b4a10 (patch) | |
tree | 648f906f13863ee81fc3cdda901bcd237af73482 | |
parent | 9702c89eba59fbf2c665a693317ba0a4f4843872 (diff) | |
download | ipmi-fru-parser-2f5a3cfd2412c7e10d128a856ad2c37c8a1b4a10.tar.gz ipmi-fru-parser-2f5a3cfd2412c7e10d128a856ad2c37c8a1b4a10.zip |
Replacing std::ifstream by access(2) for checking file existence
Fixes openbmc/ipmi-fru-parser#12.
-rw-r--r-- | writefrudata.C | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/writefrudata.C b/writefrudata.C index 7ee2127..6791148 100644 --- a/writefrudata.C +++ b/writefrudata.C @@ -663,7 +663,7 @@ int ipmi_validate_fru_area(const uint8_t fruid, const char *fru_file_name, (fruid, get_fru_area_type(fru_entry), bus_type, bmc_fru); // Physically being present - bool present = std::ifstream(fru_file_name); + bool present = access(fru_file_name, F_OK) == 0; fru_area->set_present(present); // Only setup dbus path for areas defined in BMC. |