diff options
author | 1999-08-07 17:35:58 +0000 | |
---|---|---|
committer | 1999-08-07 17:35:58 +0000 | |
commit | 160746697ac1f1e9929f1e023c4abd133e54ae37 (patch) | |
tree | c1de28041b80f236adc64654d2f6b33575d182a4 /lib/libc/stdio/refill.c | |
parent | sync (diff) | |
download | wireguard-openbsd-160746697ac1f1e9929f1e023c4abd133e54ae37.tar.xz wireguard-openbsd-160746697ac1f1e9929f1e023c4abd133e54ae37.zip |
If fread() returns EBADF, also set the error flag; tobez@plab.ku.dk
Diffstat (limited to 'lib/libc/stdio/refill.c')
-rw-r--r-- | lib/libc/stdio/refill.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/libc/stdio/refill.c b/lib/libc/stdio/refill.c index 855e5311c39..865a503228b 100644 --- a/lib/libc/stdio/refill.c +++ b/lib/libc/stdio/refill.c @@ -35,7 +35,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: refill.c,v 1.3 1996/08/19 08:33:00 tholo Exp $"; +static char rcsid[] = "$OpenBSD: refill.c,v 1.4 1999/08/07 17:35:58 millert Exp $"; #endif /* LIBC_SCCS and not lint */ #include <errno.h> @@ -75,6 +75,7 @@ __srefill(fp) if ((fp->_flags & __SRD) == 0) { if ((fp->_flags & __SRW) == 0) { errno = EBADF; + fp->_flags |= __SERR; return (EOF); } /* switch to reading */ |