X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Fclose-stream.c;h=87a59e4eeac1ad217cbd593f51d1546f5d20fcba;hb=9d3af100c7a626ed2b501fb7d0a97936f72ce9ac;hp=59ab616b1ea43eb3ccef77aed89d13175bec4607;hpb=1b3b9273dc697c2fdd1fc50a2a5e4b3908225882;p=gnulib.git diff --git a/lib/close-stream.c b/lib/close-stream.c index 59ab616b1..87a59e4ee 100644 --- a/lib/close-stream.c +++ b/lib/close-stream.c @@ -1,7 +1,6 @@ /* Close a stream, with nicer error checking than fclose's. - Copyright (C) 1998, 1999, 2000, 2001, 2002, 2004, 2006, 2007, 2008 Free - Software Foundation, Inc. + Copyright (C) 1998-2002, 2004, 2006-2010 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -56,9 +55,9 @@ int close_stream (FILE *stream) { - bool some_pending = (__fpending (stream) != 0); - bool prev_fail = (ferror (stream) != 0); - bool fclose_fail = (fclose (stream) != 0); + const bool some_pending = (__fpending (stream) != 0); + const bool prev_fail = (ferror (stream) != 0); + const bool fclose_fail = (fclose (stream) != 0); /* Return an error indication if there was a previous failure or if fclose failed, with one exception: ignore an fclose failure if @@ -71,7 +70,7 @@ close_stream (FILE *stream) if (prev_fail || (fclose_fail && (some_pending || errno != EBADF))) { if (! fclose_fail) - errno = 0; + errno = 0; return EOF; }