From owner-svn-src-stable-8@FreeBSD.ORG Tue May 8 19:33:32 2012 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 04075106567E; Tue, 8 May 2012 19:33:32 +0000 (UTC) (envelope-from jlh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E2F1C8FC1C; Tue, 8 May 2012 19:33:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q48JXVeU049067; Tue, 8 May 2012 19:33:31 GMT (envelope-from jlh@svn.freebsd.org) Received: (from jlh@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q48JXVHD049061; Tue, 8 May 2012 19:33:31 GMT (envelope-from jlh@svn.freebsd.org) Message-Id: <201205081933.q48JXVHD049061@svn.freebsd.org> From: Jeremie Le Hen Date: Tue, 8 May 2012 19:33:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r235141 - in stable/8: lib lib/libc/stdio lib/libstdbuf usr.bin usr.bin/stdbuf X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 May 2012 19:33:32 -0000 Author: jlh Date: Tue May 8 19:33:31 2012 New Revision: 235141 URL: http://svn.freebsd.org/changeset/base/235141 Log: MFC r234772: Import stdbuf(1) and the shared library it relies on. This tool changes the default buffering behaviour of standard stdio streams. It only works on dynamic binaries. To make it work for static ones it would require cluttering stdio because there no single entry point. PR: 166660 Reviewed by: current@, jhb Approved by: kib (mentor) MFC after: 1 week MFC r234773: Fix small documentation mistakes. Submitted by: brueffer Approved by: kib (mentor) MFC r234779: Use standard getopt(3) error message. Submitted by: jilles Approved by: kib (mentor) Added: - copied from r234772, head/lib/libstdbuf/ - copied from r234772, head/usr.bin/stdbuf/ Directory Properties: stable/8/lib/libstdbuf/ (props changed) stable/8/usr.bin/stdbuf/ (props changed) Modified: stable/8/lib/Makefile (contents, props changed) stable/8/lib/libc/stdio/setbuf.3 stable/8/lib/libstdbuf/libstdbuf.3 stable/8/usr.bin/Makefile stable/8/usr.bin/stdbuf/stdbuf.c Directory Properties: stable/8/lib/ (props changed) stable/8/lib/libc/ (props changed) stable/8/usr.bin/ (props changed) Modified: stable/8/lib/Makefile ============================================================================== --- stable/8/lib/Makefile Tue May 8 18:56:21 2012 (r235140) +++ stable/8/lib/Makefile Tue May 8 19:33:31 2012 (r235141) @@ -95,6 +95,7 @@ SUBDIR= ${SUBDIR_ORDERED} \ ${_libsmdb} \ ${_libsmutil} \ libstand \ + libstdbuf \ ${_libtelnet} \ ${_libthr} \ libthread_db \ Modified: stable/8/lib/libc/stdio/setbuf.3 ============================================================================== --- stable/8/lib/libc/stdio/setbuf.3 Tue May 8 18:56:21 2012 (r235140) +++ stable/8/lib/libc/stdio/setbuf.3 Tue May 8 19:33:31 2012 (r235141) @@ -83,6 +83,9 @@ normally does) it is line buffered. The standard error stream .Dv stderr is always unbuffered. +Note that these defaults may be altered using the +.Xr stdbuf 1 +utility. .Pp The .Fn setvbuf @@ -177,6 +180,7 @@ function returns what the equivalent .Fn setvbuf would have returned. .Sh SEE ALSO +.Xr stdbuf 1 , .Xr fclose 3 , .Xr fopen 3 , .Xr fread 3 , Modified: stable/8/lib/libstdbuf/libstdbuf.3 ============================================================================== --- head/lib/libstdbuf/libstdbuf.3 Sat Apr 28 20:52:20 2012 (r234772) +++ stable/8/lib/libstdbuf/libstdbuf.3 Tue May 8 19:33:31 2012 (r235141) @@ -43,7 +43,7 @@ an utility, .Xr stdbuf 1 , can be used to run a command with the appropriate environment variables. .Sh ENVIRONMENT -Each stream can be configured indepentently through the following +Each stream can be configured independently through the following environment variables (values are defined below): .Bl -tag -width size -offset indent .It Ev _STDBUF_I Modified: stable/8/usr.bin/Makefile ============================================================================== --- stable/8/usr.bin/Makefile Tue May 8 18:56:21 2012 (r235140) +++ stable/8/usr.bin/Makefile Tue May 8 19:33:31 2012 (r235141) @@ -177,6 +177,7 @@ SUBDIR= alias \ sockstat \ split \ stat \ + stdbuf \ su \ systat \ tabs \ Modified: stable/8/usr.bin/stdbuf/stdbuf.c ============================================================================== --- head/usr.bin/stdbuf/stdbuf.c Sat Apr 28 20:52:20 2012 (r234772) +++ stable/8/usr.bin/stdbuf/stdbuf.c Tue May 8 19:33:31 2012 (r235141) @@ -52,7 +52,7 @@ main(int argc, char *argv[]) int i; ibuf = obuf = ebuf = NULL; - while ((i = getopt(argc, argv, ":e:i:o:")) != -1) { + while ((i = getopt(argc, argv, "e:i:o:")) != -1) { switch (i) { case 'e': ebuf = optarg; @@ -63,13 +63,8 @@ main(int argc, char *argv[]) case 'o': obuf = optarg; break; - case ':': - warnx("Missing argument for option -%c", optopt); - usage(1); - break; case '?': default: - warnx("Unknown option: %c", optopt); usage(1); break; }