svn commit: samba r18343 - in branches/SAMBA_4_0/source: lib/replace lib/replace/test torture utils/net

tridge at samba.org tridge at samba.org
Sun Sep 10 14:19:39 GMT 2006


Author: tridge
Date: 2006-09-10 14:19:38 +0000 (Sun, 10 Sep 2006)
New Revision: 18343

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=18343

Log:

fixed setlinebuf() prototype, added test for it, and use it in two
places to avoid a #ifdef

Modified:
   branches/SAMBA_4_0/source/lib/replace/replace.c
   branches/SAMBA_4_0/source/lib/replace/replace.h
   branches/SAMBA_4_0/source/lib/replace/test/testsuite.c
   branches/SAMBA_4_0/source/torture/smbtorture.c
   branches/SAMBA_4_0/source/utils/net/net.c


Changeset:
Modified: branches/SAMBA_4_0/source/lib/replace/replace.c
===================================================================
--- branches/SAMBA_4_0/source/lib/replace/replace.c	2006-09-10 13:51:57 UTC (rev 18342)
+++ branches/SAMBA_4_0/source/lib/replace/replace.c	2006-09-10 14:19:38 UTC (rev 18343)
@@ -338,9 +338,9 @@
 #endif
 
 #ifndef HAVE_SETLINEBUF
-int rep_setlinebuf(FILE *stream)
+void rep_setlinebuf(FILE *stream)
 {
-	return setvbuf(stream, (char *)NULL, _IOLBF, 0);
+	setvbuf(stream, (char *)NULL, _IOLBF, 0);
 }
 #endif /* HAVE_SETLINEBUF */
 

Modified: branches/SAMBA_4_0/source/lib/replace/replace.h
===================================================================
--- branches/SAMBA_4_0/source/lib/replace/replace.h	2006-09-10 13:51:57 UTC (rev 18342)
+++ branches/SAMBA_4_0/source/lib/replace/replace.h	2006-09-10 14:19:38 UTC (rev 18343)
@@ -140,7 +140,7 @@
 
 #ifndef HAVE_SETLINEBUF
 #define setlinebuf rep_setlinebuf
-int rep_setlinebuf(FILE *);
+void rep_setlinebuf(FILE *);
 #endif
 
 #ifndef HAVE_STRCASESTR

Modified: branches/SAMBA_4_0/source/lib/replace/test/testsuite.c
===================================================================
--- branches/SAMBA_4_0/source/lib/replace/test/testsuite.c	2006-09-10 13:51:57 UTC (rev 18342)
+++ branches/SAMBA_4_0/source/lib/replace/test/testsuite.c	2006-09-10 14:19:38 UTC (rev 18343)
@@ -146,7 +146,8 @@
 
 static int test_setlinebuf(void)
 {
-	/* FIXME */
+	printf("testing setlinebuf\n");
+	setlinebuf(stdout);
 	return true;
 }
 

Modified: branches/SAMBA_4_0/source/torture/smbtorture.c
===================================================================
--- branches/SAMBA_4_0/source/torture/smbtorture.c	2006-09-10 13:51:57 UTC (rev 18342)
+++ branches/SAMBA_4_0/source/torture/smbtorture.c	2006-09-10 14:19:38 UTC (rev 18343)
@@ -413,9 +413,7 @@
 		{ NULL }
 	};
 
-#ifdef HAVE_SETBUFFER
-	setbuffer(stdout, NULL, 0);
-#endif
+	setlinebuf(stdout);
 
 	/* we are never interested in SIGPIPE */
 	BlockSignals(True,SIGPIPE);

Modified: branches/SAMBA_4_0/source/utils/net/net.c
===================================================================
--- branches/SAMBA_4_0/source/utils/net/net.c	2006-09-10 13:51:57 UTC (rev 18342)
+++ branches/SAMBA_4_0/source/utils/net/net.c	2006-09-10 14:19:38 UTC (rev 18343)
@@ -151,9 +151,7 @@
 		{ NULL }
 	};
 
-#ifdef HAVE_SETBUFFER
-	setbuffer(stdout, NULL, 0);
-#endif
+	setlinebuf(stdout);
 
 	pc = poptGetContext("net", argc, (const char **) argv, long_options, 
 			    POPT_CONTEXT_KEEP_FIRST);



More information about the samba-cvs mailing list