<html><body><p>hello Sam,<br><br>Thanks for the review and suggestion.. I refreshed the pull request.<br><br>Thanks<br><br>-------------------------------------------------------------------------------------<br>Thanks and Regards,<br>Vishwanath.<br>Advisory Software Engineer,<br>Power Firmware Development, <br>Systems &Technology Lab,<br>MG2-6F-255 , Manyata Embassy Business Park, <br>Bangalore , KA , 560045<br>Ph: +91-80-46678255<br>E-mail: vishwanath@in.ibm.com<br>----------------------------------------------------------------------------------<br><br><tt>"openbmc" <openbmc-bounces+vishwanath=in.ibm.com@lists.ozlabs.org> wrote on 31/05/2016 04:51:02 am:<br><br>> From: Samuel Mendoza-Jonas <sam@mendozajonas.com></tt><br><tt>> To: OpenBMC Patches <openbmc-patches@stwcx.xyz></tt><br><tt>> Cc: openbmc@lists.ozlabs.org</tt><br><tt>> Date: 31/05/2016 04:52 am</tt><br><tt>> Subject: Re: [PATCH ipmi-fru-parser] Replacing std::ifstream by <br>> access(2) for checking file existence</tt><br><tt>> Sent by: "openbmc" <openbmc-bounces+vishwanath=in.ibm.com@lists.ozlabs.org></tt><br><tt>> <br>> On Mon, May 30, 2016 at 03:20:14AM -0500, OpenBMC Patches wrote:<br>> > From: vishwa <vishwanath@in.ibm.com><br>> > <br>> > ---<br>> > writefrudata.C | 2 +-<br>> > 1 file changed, 1 insertion(+), 1 deletion(-)<br>> > <br>> > diff --git a/writefrudata.C b/writefrudata.C<br>> > index 7ee2127..6e28341 100644<br>> > --- a/writefrudata.C<br>> > +++ b/writefrudata.C<br>> > @@ -663,7 +663,7 @@ int ipmi_validate_fru_area(const uint8_t <br>> fruid, const char *fru_file_name,<br>> > (fruid, get_fru_area_type(fru_entry), <br>> bus_type, bmc_fru);<br>> > <br>> > // Physically being present<br>> > - bool present = std::ifstream(fru_file_name);<br>> > + bool present = (access(fru_file_name, F_OK) != -1) ? true : false;<br>> <br>> Hi Vishwa,<br>> <br>> Since (access(..) != -1) returns a boolean you can simplify this to:<br>> <br>> bool present = access(fru_file_name, F_OK) != -1;<br>> <br>> > fru_area->set_present(present);<br>> > <br>> > // Only setup dbus path for areas defined in BMC.<br>> > -- <br>> > 2.8.3<br>> > <br>> > <br>> > _______________________________________________<br>> > openbmc mailing list<br>> > openbmc@lists.ozlabs.org<br>> > <a href="https://lists.ozlabs.org/listinfo/openbmc">https://lists.ozlabs.org/listinfo/openbmc</a><br>> <br>> _______________________________________________<br>> openbmc mailing list<br>> openbmc@lists.ozlabs.org<br>> <a href="https://lists.ozlabs.org/listinfo/openbmc">https://lists.ozlabs.org/listinfo/openbmc</a><br></tt><BR>
</body></html>