]> git.saurik.com Git - apple/libc.git/blob - stdio/FreeBSD/wbuf.c.patch
Libc-320.1.3.tar.gz
[apple/libc.git] / stdio / FreeBSD / wbuf.c.patch
1 --- wbuf.c.orig Mon Mar 22 13:35:00 2004
2 +++ wbuf.c Mon Mar 22 13:38:02 2004
3 @@ -41,6 +41,7 @@
4 __FBSDID("$FreeBSD: src/lib/libc/stdio/wbuf.c,v 1.10 2002/08/13 09:30:41 tjr Exp $");
5
6 #include <stdio.h>
7 +#include <errno.h>
8 #include "local.h"
9
10 /*
11 @@ -65,8 +66,10 @@
12 * calls might wrap _w from negative to positive.
13 */
14 fp->_w = fp->_lbfsize;
15 - if (cantwrite(fp))
16 + if (cantwrite(fp)) {
17 + errno = EBADF;
18 return (EOF);
19 + }
20 c = (unsigned char)c;
21
22 ORIENT(fp, -1);