On Thu, 06 Jan 2011 07:21:18 +0100 Sebastian Dransfeld <s...@tango.flipp.net> wrote:
> On 01/05/2011 09:18 PM, Lucas De Marchi wrote: > >> + if (errno) > > > > This is bad... you have to either zero errno before calling open() or check > > the return value before. Since open() will not zero errno in case of > > succees, doing like you did you're actually carrying whatever value errno > > had. > > Should users always zero errno before checking? Then this needs to be > checked throughout efl. I remember a while ago someone actually removed > errno = 0 in some code. > > Sebastian > Yes, I remember someone removing the errno checks as well. According to the man page, however, you must set it to 0 before you check it to receive valid results, so I would guess that this is indeed something that should be verified throughout the codebase. Perhaps a good opportunity for a cocci script? :) -- Mike Blumenkrantz Zentific: NULL pointer dereferences now 50% off! ------------------------------------------------------------------------------ Learn how Oracle Real Application Clusters (RAC) One Node allows customers to consolidate database storage, standardize their database environment, and, should the need arise, upgrade to a full multi-node Oracle RAC database without downtime or disruption http://p.sf.net/sfu/oracle-sfdevnl _______________________________________________ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel