summaryrefslogtreecommitdiff
path: root/lib/fclose.c
Commit message (Collapse)AuthorAgeFilesLines
* maint: update all copyright year number rangesJim Meyering2012-01-011-1/+1
| | | | Run "make update-copyright".
* fclose: Support for MSVC 9.Bruno Haible2011-09-251-5/+31
| | | | | | | | * lib/fclose.c: Include msvc-inval.h. (fclose_nothrow): New function. (rpl_fclose): Use it. * modules/fclose (Depends-on): Add msvc-inval. * doc/posix-functions/fclose.texi: Mention the problem on MSVC.
* fclose: Fix mistake earlier today.Bruno Haible2011-05-121-1/+1
| | | | * lib/fclose.c (rpl_fclose): Don't assume that EOF < 0.
* fclose: preserve fflush errorsEric Blake2011-05-111-6/+6
| | | | | | | | | Caught by gcc -Werror=unused-but-set-variable. * lib/fclose.c (rpl_fclose): Don't lose fflush errors. Reported by Jim Meyering. Signed-off-by: Eric Blake <eblake@redhat.com>
* fclose: Fix possible link error.Bruno Haible2011-05-111-7/+16
| | | | | | | * lib/fclose.c (rpl_fclose): Invoke _gl_unregister_fd, not unregister_shadow_fd. Improve comments. * lib/sockets.c (close_fd_maybe_socket): Add comments. Reported by Eric Blake.
* fclose: avoid double close race when possibleEric Blake2011-05-101-3/+19
| | | | | | | | | | | | | | | Calling close(fileno(fp)) prior to fclose(fp) is racy in a multi-threaded application - some other thread could open a new file, which is then inadvertently closed by the fclose that we thought should fail with EBADF. For mingw, this is no worse than the race already present in close_fd_maybe_socket for calling closesocket() prior to _close(), but for all other platforms, we might as well be nice and avoid the race. * lib/fclose.c (rpl_fclose): Rewrite to avoid double-close race on all but WINDOWS_SOCKETS. Signed-off-by: Eric Blake <eblake@redhat.com>
* fflush: also replace fclose when fixing fflushEric Blake2011-05-021-2/+8
| | | | | | | | | | | | | | | | | | | | This fixes the fclose failures detected in the previous patch, but only when the GPL fflush module is also in use. That is because the need for behavior of resetting seekable input streams is much less common, and the fix more complex. The LGPLv2+ test for fclose() in isolation is relaxed to pass if fflush is not being replaced to cater to input streams. * modules/fflush (Depends-on): Add fclose. * m4/fflush.m4 (gl_FUNC_FFLUSH): Also replace fclose. * lib/fclose.c (rpl_fclose): Don't cause spurious failures on memstreams with no backing fd. * doc/posix-functions/fclose.texi (fclose): Document the use of fflush module to fix the bug. * tests/test-fclose.c (main): Relax test when fclose is used in isolation. Signed-off-by: Eric Blake <eblake@redhat.com>
* fclose: reduce dependenciesEric Blake2011-05-021-2/+4
| | | | | | | | | | | | In an LGPLv2+ project, the last change to fclose dragged in inappropriate modules. * modules/fclose (Depends-on): Switch from fflush/fseeko to simpler lseek. * lib/fclose.c (rpl_fclose): Likewise. Reported by Simon Josefsson. Signed-off-by: Eric Blake <eblake@redhat.com>
* fclose: don't fail on non-seekable input streamEric Blake2011-04-301-1/+5
| | | | | | | | | | | | On mingw, for a project that uses both sockets and streams, then fclose(stdin) when getting input from a terminal or pipe was spuriously failing. * modules/fclose (Depends-on): Add freading, fflush, fseeko. * lib/fclose.c (rpl_fclose): Skip fflush for non-seekable input, since fflush is allowed to fail in that case. Signed-off-by: Eric Blake <eblake@redhat.com>
* maint: update almost all copyright ranges to include 2011Jim Meyering2011-01-011-1/+1
| | | | Run the new "make update-copyright" rule.
* update nearly all FSF copyright year lists to include 2010Jim Meyering2010-01-011-1/+1
| | | | | Use the same procedure as for 2009, outlined in http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/20081
* update nearly all FSF copyright year lists to include 2009Jim Meyering2009-12-291-1/+1
| | | | | | | | | | | | | | | | | | The files named by the following are exempted: grep -v '^#' config/srclist.txt|grep -v '^$' \ | while read src dst; do test -f "$dst" && { echo "$dst"; continue; } test -d "$dst" || continue echo "$dst"/$(basename "$src") done > exempt git ls-files tests/unictype >> exempt In the remaining files, convert to all-interval notation if - there is already at least one year interval like 2000-2003 - the file is maintained by me - the file is in lib/uni*/, where that style already prevails Otherwise, use update-copyright's default.
* * lib/fclose.c: Fix typo in comment: s/close/fclose/.Jim Meyering2008-10-111-1/+1
|
* New module 'fclose'.Bruno Haible2008-10-111-0/+47