[PATCH ipmi-fru-parser v3] Replacing std::ifstream by access(2) for checking file existence

OpenBMC Patches openbmc-patches at stwcx.xyz
Wed Jun 1 17:30:17 AEST 2016


From: vishwa <vishwanath at in.ibm.com>

---
 writefrudata.C | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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.
-- 
2.8.3




More information about the openbmc mailing list