]> git.saurik.com Git - apple/libc.git/blobdiff - stdio/FreeBSD/wbuf.c.patch
Libc-320.1.3.tar.gz
[apple/libc.git] / stdio / FreeBSD / wbuf.c.patch
diff --git a/stdio/FreeBSD/wbuf.c.patch b/stdio/FreeBSD/wbuf.c.patch
new file mode 100644 (file)
index 0000000..8f1aa70
--- /dev/null
@@ -0,0 +1,22 @@
+--- wbuf.c.orig        Mon Mar 22 13:35:00 2004
++++ wbuf.c     Mon Mar 22 13:38:02 2004
+@@ -41,6 +41,7 @@
+ __FBSDID("$FreeBSD: src/lib/libc/stdio/wbuf.c,v 1.10 2002/08/13 09:30:41 tjr Exp $");
+ #include <stdio.h>
++#include <errno.h>
+ #include "local.h"
+ /*
+@@ -65,8 +66,10 @@
+        * calls might wrap _w from negative to positive.
+        */
+       fp->_w = fp->_lbfsize;
+-      if (cantwrite(fp))
++      if (cantwrite(fp)) {
++              errno = EBADF;
+               return (EOF);
++      }
+       c = (unsigned char)c;
+       ORIENT(fp, -1);