diff options
-rw-r--r-- | lib/libc/stdio/wbuf.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/libc/stdio/wbuf.c b/lib/libc/stdio/wbuf.c index 0cef3704a27..ae6f05ca6a9 100644 --- a/lib/libc/stdio/wbuf.c +++ b/lib/libc/stdio/wbuf.c @@ -35,7 +35,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: wbuf.c,v 1.2 1996/08/19 08:33:15 tholo Exp $"; +static char rcsid[] = "$OpenBSD: wbuf.c,v 1.3 1997/05/31 08:45:51 tholo Exp $"; #endif /* LIBC_SCCS and not lint */ #include <stdio.h> @@ -60,8 +60,10 @@ __swbuf(c, fp) * calls might wrap _w from negative to positive. */ fp->_w = fp->_lbfsize; - if (cantwrite(fp)) + if (cantwrite(fp)) { + errno = EBADF; return (EOF); + } c = (unsigned char)c; /* |