From: nekral-guest Date: Wed, 17 Mar 2010 23:59:47 +0000 (+0000) Subject: * lib/commonio.c: Avoid implicit conversion of pointers to X-Git-Tag: 4.1.5~338 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fe71812b1df6b49d26046f44f125c25a56a91c2a;p=thirdparty%2Fshadow.git * lib/commonio.c: Avoid implicit conversion of pointers to booleans. * lib/commonio.c: Ignore the return value of close when a failure is reported. --- diff --git a/ChangeLog b/ChangeLog index a8ca29041..8831df212 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2010-03-17 Nicolas François + + * lib/commonio.c: Avoid implicit conversion of pointers to + booleans. + * lib/commonio.c: Ignore the return value of close when a + failure is reported. + 2010-03-16 Nicolas François * man/faillog.8.xml: Document the behavior in display mode of the @@ -878,7 +885,7 @@ 2009-04-30 Nicolas François - * lib/commonio.c: Ignore teh return values of fclose() and + * lib/commonio.c: Ignore the return values of fclose() and unlink() in case of failure of fopen_set_perms() or create_backup(). * lib/commonio.c: Should the backup file be unlink'ed in case of diff --git a/lib/commonio.c b/lib/commonio.c index 03b001e06..fa37704c7 100644 --- a/lib/commonio.c +++ b/lib/commonio.c @@ -572,8 +572,8 @@ int commonio_open (struct commonio_db *db, int mode) #endif /* WITH_TCB */ db->fp = fdopen (fd, db->readonly ? "r" : "r+"); saved_errno = errno; - if (!db->fp) { - close (fd); + if (NULL == db->fp) { + (void) close (fd); } } errno = saved_errno;