X-Git-Url: https://git.saurik.com/apple/libc.git/blobdiff_plain/1f2f436a38f7ae2d39a943ad2898d8fed4ed2e58..refs/heads/master:/stdio/FreeBSD/wbuf.c diff --git a/stdio/FreeBSD/wbuf.c b/stdio/FreeBSD/wbuf.c index 4f1c4aa..9e9b59e 100644 --- a/stdio/FreeBSD/wbuf.c +++ b/stdio/FreeBSD/wbuf.c @@ -37,6 +37,7 @@ static char sccsid[] = "@(#)wbuf.c 8.1 (Berkeley) 6/4/93"; __FBSDID("$FreeBSD: src/lib/libc/stdio/wbuf.c,v 1.12 2007/01/09 00:28:08 imp Exp $"); #include +#include #include "local.h" /* @@ -61,8 +62,10 @@ __swbuf(c, fp) * calls might wrap _w from negative to positive. */ fp->_w = fp->_lbfsize; - if (prepwrite(fp) != 0) + if (prepwrite(fp) != 0) { + errno = EBADF; return (EOF); + } c = (unsigned char)c; ORIENT(fp, -1);