]> git.saurik.com Git - apple/libc.git/blob - stdio/FreeBSD/wbuf.c.patch
Libc-391.tar.gz
[apple/libc.git] / stdio / FreeBSD / wbuf.c.patch
1 --- wbuf.c.orig 2004-06-07 22:45:32.000000000 -0700
2 +++ wbuf.c 2004-10-25 00:49:10.000000000 -0700
3 @@ -41,6 +41,7 @@
4 __FBSDID("$FreeBSD: src/lib/libc/stdio/wbuf.c,v 1.11 2004/06/08 05:45:32 das 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 (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);