Replacing std::ifstream by access(2) for checking file existence
Fixes openbmc/ipmi-fru-parser#12.
diff --git a/writefrudata.C b/writefrudata.C
index 7ee2127..6791148 100644
--- a/writefrudata.C
+++ b/writefrudata.C
@@ -663,7 +663,7 @@
(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.