summaryrefslogtreecommitdiffstats
path: root/lib/libc/stdio/refill.c
diff options
context:
space:
mode:
authormillert <millert@openbsd.org>1999-08-07 17:35:58 +0000
committermillert <millert@openbsd.org>1999-08-07 17:35:58 +0000
commit160746697ac1f1e9929f1e023c4abd133e54ae37 (patch)
treec1de28041b80f236adc64654d2f6b33575d182a4 /lib/libc/stdio/refill.c
parentsync (diff)
downloadwireguard-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.c3
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 */