Loading...
stdio/FreeBSD/fputs.c.patch Libc-391.1.21 Libc-763.12
--- Libc/Libc-391.1.21/stdio/FreeBSD/fputs.c.patch
+++ Libc/Libc-763.12/stdio/FreeBSD/fputs.c.patch
@@ -1,6 +1,6 @@
---- fputs.c.orig	Tue May 20 15:22:42 2003
-+++ fputs.c	Thu Jul 31 13:19:02 2003
-@@ -48,6 +48,9 @@
+--- fputs.c.bsdnew	2009-11-11 13:33:08.000000000 -0800
++++ fputs.c	2009-11-11 13:33:08.000000000 -0800
+@@ -44,6 +44,9 @@ __FBSDID("$FreeBSD: src/lib/libc/stdio/f
  #include "libc_private.h"
  #include "local.h"
  
@@ -10,7 +10,7 @@
  /*
   * Write the given string to the given file.
   */
-@@ -60,6 +63,9 @@
+@@ -56,6 +59,9 @@ fputs(s, fp)
  	struct __suio uio;
  	struct __siov iov;
  
@@ -20,3 +20,13 @@
  	iov.iov_base = (void *)s;
  	iov.iov_len = uio.uio_resid = strlen(s);
  	uio.uio_iov = &iov;
+@@ -64,5 +70,9 @@ fputs(s, fp)
+ 	ORIENT(fp, -1);
+ 	retval = __sfvwrite(fp, &uio);
+ 	FUNLOCKFILE(fp);
++#if __DARWIN_UNIX03
++	if (retval == 0)
++		return iov.iov_len;
++#endif /* __DARWIN_UNIX03 */
+ 	return (retval);
+ }