Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 7 Dec 2014 20:15:08 +0000 (UTC)
From:      "Pedro F. Giffuni" <pfg@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r275581 - head/usr.bin/patch
Message-ID:  <201412072015.sB7KF8Hj099176@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: pfg
Date: Sun Dec  7 20:15:07 2014
New Revision: 275581
URL: https://svnweb.freebsd.org/changeset/base/275581

Log:
  Prefer setvbuf() to setlinebuf().
  
  On FreeBSD's libc setlinebuf is a wrapper to setvbuf anyways.
  
  Obtained from:	OpenBSD
  MFC after:	5 days

Modified:
  head/usr.bin/patch/patch.c

Modified: head/usr.bin/patch/patch.c
==============================================================================
--- head/usr.bin/patch/patch.c	Sun Dec  7 18:17:24 2014	(r275580)
+++ head/usr.bin/patch/patch.c	Sun Dec  7 20:15:07 2014	(r275581)
@@ -23,7 +23,7 @@
  * -C option added in 1998, original code by Marc Espie, based on FreeBSD
  * behaviour
  *
- * $OpenBSD: patch.c,v 1.50 2012/05/15 19:32:02 millert Exp $
+ * $OpenBSD: patch.c,v 1.52 2014/11/26 18:34:51 millert Exp $
  * $FreeBSD$
  *
  */
@@ -150,8 +150,8 @@ main(int argc, char *argv[])
 	const	char *tmpdir;
 	char	*v;
 
-	setlinebuf(stdout);
-	setlinebuf(stderr);
+	setvbuf(stdout, NULL, _IOLBF, 0);
+	setvbuf(stderr, NULL, _IOLBF, 0);
 	for (i = 0; i < MAXFILEC; i++)
 		filearg[i] = NULL;
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201412072015.sB7KF8Hj099176>