]> git.saurik.com Git - apple/libc.git/blob - stdio/FreeBSD/wbuf.c.patch
Libc-763.11.tar.gz
[apple/libc.git] / stdio / FreeBSD / wbuf.c.patch
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 $");
5
6 #include <stdio.h>
7 +#include <errno.h>
8 #include "local.h"
9
10 /*
11 @@ -61,8 +62,10 @@ __swbuf(c, fp)
12 * calls might wrap _w from negative to positive.
13 */
14 fp->_w = fp->_lbfsize;
15 - if (prepwrite(fp) != 0)
16 + if (prepwrite(fp) != 0) {
17 + errno = EBADF;
18 return (EOF);
19 + }
20 c = (unsigned char)c;
21
22 ORIENT(fp, -1);