Description
Current Stat64_to_stat macro leads to a nasty bug.
The Macro expands to several lines, and Stat64_to_stat is used as:
if (!ret)
stat64_to_stat(&buf64, buf);
so the first expanded line will be conditioned to if(!ret) but the rest of the macro will be unconditioned executed.
The patch modifies:
if (!ret)
stat64_to_stat(&buf64, buf);
to
if (!ret)
{ stat64_to_stat(&buf64, buf); }Also adds a comment in the MACRO function.
There are other potential alternatives, but does the code less readable.
http://www.parashift.com/c++-faq/macros-with-multi-stmts.html