diff options
| author | Jörg Frings-Fürst <debian@jff.email> | 2026-03-10 13:24:07 +0100 |
|---|---|---|
| committer | Jörg Frings-Fürst <debian@jff.email> | 2026-03-10 13:24:07 +0100 |
| commit | cfd1f17f1a85d95ea12bca8dae42add7dad1ad11 (patch) | |
| tree | 8016486f8ee7157213f2d09ff2491bfa9c94638a /lib/fseterr.c | |
| parent | 14e4d584d0121031ec40e6c35869745f1747ff29 (diff) | |
| parent | 1403307d6e2fb4e7b5d97a35f40d1e95134561ab (diff) | |
Merge branch 'release/debian/1.4.2-1'HEADdebian/1.4.2-1master
Diffstat (limited to 'lib/fseterr.c')
| -rw-r--r-- | lib/fseterr.c | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/lib/fseterr.c b/lib/fseterr.c index 2504205e..0ab61765 100644 --- a/lib/fseterr.c +++ b/lib/fseterr.c @@ -1,5 +1,5 @@ /* Set the error indicator of a stream. - Copyright (C) 2007-2024 Free Software Foundation, Inc. + Copyright (C) 2007-2026 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as @@ -24,7 +24,7 @@ #include "stdio-impl.h" /* This file is not used on systems that have the __fseterr function, - namely musl libc. */ + namely OpenBSD >= 7.6, musl libc, Haiku >= hrev58760. */ void fseterr (FILE *fp) @@ -36,13 +36,13 @@ fseterr (FILE *fp) /* GNU libc, BeOS, Haiku, Linux libc5 */ fp->_flags |= _IO_ERR_SEEN; #elif defined __sferror || defined __DragonFly__ || defined __ANDROID__ - /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */ + /* FreeBSD, NetBSD, OpenBSD < 7.6, DragonFly, Mac OS X, Cygwin, Minix 3, Android */ fp_->_flags |= __SERR; #elif defined __EMX__ /* emx+gcc */ fp->_flags |= _IOERR; #elif defined __minix /* Minix */ fp->_flags |= _IOERR; -#elif defined _IOERR /* AIX, HP-UX, IRIX, OSF/1, Solaris, OpenServer, UnixWare, mingw, MSVC, NonStop Kernel, OpenVMS */ +#elif defined _IOERR /* AIX, HP-UX, Solaris, OpenServer, UnixWare, mingw, MSVC, NonStop Kernel, OpenVMS */ fp_->_flag |= _IOERR; #elif defined __UCLIBC__ /* uClibc */ fp->__modeflags |= __FLAG_ERROR; @@ -59,14 +59,10 @@ fseterr (FILE *fp) Not activated on any system, because there is no way to repair FP when the sequence of system calls fails, and library code should not call abort(). */ - int saved_errno; - int fd; - int fd2; - - saved_errno = errno; + int saved_errno = errno; fflush (fp); - fd = fileno (fp); - fd2 = dup (fd); + int fd = fileno (fp); + int fd2 = dup (fd); if (fd2 >= 0) { close (fd); |
