From owner-svn-src-all@FreeBSD.ORG Sat Jun 21 05:47:57 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F2AD73EA; Sat, 21 Jun 2014 05:47:56 +0000 (UTC) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 932182246; Sat, 21 Jun 2014 05:47:56 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.9/8.14.9) with ESMTP id s5L5liWh076558; Sat, 21 Jun 2014 08:47:44 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.8.3 kib.kiev.ua s5L5liWh076558 Received: (from kostik@localhost) by tom.home (8.14.9/8.14.8/Submit) id s5L5liWQ076557; Sat, 21 Jun 2014 08:47:44 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 21 Jun 2014 08:47:44 +0300 From: Konstantin Belousov To: "Pedro F. Giffuni" Subject: Re: svn commit: r267692 - head/usr.bin/sed Message-ID: <20140621054744.GN3991@kib.kiev.ua> References: <201406202141.s5KLfU2J047433@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Qf+2chOW7Mplyx0V" Content-Disposition: inline In-Reply-To: <201406202141.s5KLfU2J047433@svn.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on tom.home Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Jun 2014 05:47:57 -0000 --Qf+2chOW7Mplyx0V Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Jun 20, 2014 at 09:41:30PM +0000, Pedro F. Giffuni wrote: > Author: pfg > Date: Fri Jun 20 21:41:30 2014 > New Revision: 267692 > URL: http://svnweb.freebsd.org/changeset/base/267692 >=20 > Log: > Add -u (unbuffered output) after GNU sed. > =20 > Obtained from: NetBSD > MFC after: 1 week >=20 > Modified: > head/usr.bin/sed/main.c > head/usr.bin/sed/sed.1 >=20 > Modified: head/usr.bin/sed/main.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/usr.bin/sed/main.c Fri Jun 20 21:35:39 2014 (r267691) > +++ head/usr.bin/sed/main.c Fri Jun 20 21:41:30 2014 (r267692) > @@ -132,7 +132,7 @@ main(int argc, char *argv[]) > fflag =3D 0; > inplace =3D NULL; > =20 > - while ((c =3D getopt(argc, argv, "EI:ae:f:i:lnr")) !=3D -1) > + while ((c =3D getopt(argc, argv, "EI:ae:f:i:lnru")) !=3D -1) > switch (c) { > case 'r': /* Gnu sed compat */ > case 'E': > @@ -168,6 +168,16 @@ main(int argc, char *argv[]) > case 'n': > nflag =3D 1; > break; > + case 'u': > +#ifdef _IONBF > + c =3D setvbuf(stdout, NULL, _IONBF, 0); > +#else > + c =3D -1; > + errno =3D EOPNOTSUPP; > +#endif > + if (c) Why doing it that way ? IMO the conditional is useless and even wrong. FreeBSD provides the _IONBF, _IONBF is required by C99. If some other system lacks _IONBF, it should get compiler error instead of silently accepting non-working code. --Qf+2chOW7Mplyx0V Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBAgAGBQJTpRyAAAoJEJDCuSvBvK1BxWUP/2P8sJecoOoysvFOIfuk+tem 19X0b+4607/qNrLaLMBMxlW+LEMBPsUSGPGb6OKf5Z75iZLevAs3fl35DpYSUX8c RqUDHq0ORz+AXFldCZlRFcD0rTpe76vjGFgE5qE16fUuXuweZ9AmVIBU5jn0CrsC +KmD1lULMypw05m15OGttUfJCBvUo9ybOSsUFM65Vy/9RQHEVCrgeKw1i/fO5PqV DB8t3TsnTcohqLa51CH7cG6ceAlBi4tZD0oScgEMr5+HHsRYG95cSjVf4TapV2T+ LwFvDZAMvYnjb3M3TILzwzjLZg0jqwFhASimt/AaJ7GREU4eEnPWJsPRr0MFS53K bK7oHxYuL5BmS+K/g3rkwu1TyJREZtYfqgfZ28fSH9JKaXrbqAS1ZrmSbR1+eMlw nizT6GcI7azw1NnvhfmyTNIByxAczeootcNSI1FHYAYjZWqIxYlZ75omW7LILsvz CjoZjNS+mLvjiG0y3ZJoYmrs3u1GpbR/zuhAemk5UeIeNdX6o/JffbLyULIRAhGl BANT34ip8je1UJdDB1tXmyJMo+LLT2hLvz2Kcd+6rcd9vY45qzMrf/saWkX+OoWU pNOIMX1myQovyjw/7UBO17gCFqqGkYYf2J6HPUNZllZ1kEiUYWeGiOJrdAMnn2/l PBH4g6M3hVVPesPOUig2 =HRIf -----END PGP SIGNATURE----- --Qf+2chOW7Mplyx0V--