]> git.saurik.com Git - apple/libc.git/blame - stdio/FreeBSD/wbuf.c.patch
Libc-763.13.tar.gz
[apple/libc.git] / stdio / FreeBSD / wbuf.c.patch
CommitLineData
1f2f436a
A
1--- wbuf.c.bsdnew 2009-11-11 13:33:20.000000000 -0800
2+++ wbuf.c 2009-11-11 13:33:22.000000000 -0800
3@@ -37,6 +37,7 @@ static char sccsid[] = "@(#)wbuf.c 8.1 (
4 __FBSDID("$FreeBSD: src/lib/libc/stdio/wbuf.c,v 1.12 2007/01/09 00:28:08 imp Exp $");
51631861
A
5
6 #include <stdio.h>
7+#include <errno.h>
8 #include "local.h"
9
10 /*
1f2f436a 11@@ -61,8 +62,10 @@ __swbuf(c, fp)
51631861
A
12 * calls might wrap _w from negative to positive.
13 */
14 fp->_w = fp->_lbfsize;
3d9156a7
A
15- if (prepwrite(fp) != 0)
16+ if (prepwrite(fp) != 0) {
51631861
A
17+ errno = EBADF;
18 return (EOF);
19+ }
20 c = (unsigned char)c;
21
22 ORIENT(fp, -1);