Loading...
stdio/FreeBSD/makebuf.c.patch Libc-583 Libc-498.1.1
--- Libc/Libc-583/stdio/FreeBSD/makebuf.c.patch
+++ Libc/Libc-498.1.1/stdio/FreeBSD/makebuf.c.patch
@@ -1,16 +1,15 @@
---- makebuf.c.orig	2008-08-28 17:18:09.000000000 -0700
-+++ makebuf.c	2008-09-04 14:20:48.000000000 -0700
-@@ -49,6 +49,9 @@ __FBSDID("$FreeBSD: src/lib/libc/stdio/m
+--- makebuf.c.orig	2006-10-11 20:54:06.000000000 -0700
++++ makebuf.c	2006-10-12 10:09:09.000000000 -0700
+@@ -49,6 +49,8 @@
  #include "local.h"
  #include "un-namespace.h"
  
-+#define MAXBUFSIZE	(1 << 16)
 +#define TTYBUFSIZE	4096
 +
  /*
   * Allocate a file buffer, or switch to unbuffered I/O.
   * Per the ANSI C standard, ALL tty devices default to line buffered.
-@@ -71,6 +74,12 @@ __smakebuf(fp)
+@@ -71,6 +73,12 @@
  		return;
  	}
  	flags = __swhatbuf(fp, &size, &couldbetty);
@@ -23,7 +22,7 @@
  	if ((p = malloc(size)) == NULL) {
  		fp->_flags |= __SNBF;
  		fp->_bf._base = fp->_p = fp->_nbuf;
-@@ -81,8 +90,6 @@ __smakebuf(fp)
+@@ -81,8 +89,6 @@
  	flags |= __SMBF;
  	fp->_bf._base = fp->_p = p;
  	fp->_bf._size = size;
@@ -32,13 +31,3 @@
  	fp->_flags |= flags;
  }
  
-@@ -115,8 +122,7 @@ __swhatbuf(fp, bufsize, couldbetty)
- 	 * __sseek is mainly paranoia.)  It is safe to set _blksize
- 	 * unconditionally; it will only be used if __SOPT is also set.
- 	 */
--	*bufsize = st.st_blksize;
--	fp->_blksize = st.st_blksize;
-+	fp->_blksize = *bufsize = st.st_blksize > MAXBUFSIZE ? MAXBUFSIZE : st.st_blksize;
- 	return ((st.st_mode & S_IFMT) == S_IFREG && fp->_seek == __sseek ?
- 	    __SOPT : __SNPT);
- }