From owner-svn-src-head@FreeBSD.ORG Sat Jun 21 06:06:15 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4F2C266A for ; Sat, 21 Jun 2014 06:06:15 +0000 (UTC) Received: from nm21.bullet.mail.bf1.yahoo.com (nm21.bullet.mail.bf1.yahoo.com [98.139.212.180]) (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 F18102390 for ; Sat, 21 Jun 2014 06:06:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1403330767; bh=ORJl3h+5mUSwo4vyJrMXvRKqMWLh9763nD6jbvPuK6g=; h=Received:Received:Received:X-Yahoo-Newman-Id:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:X-Rocket-Received:Content-Type:Mime-Version:Subject:From:In-Reply-To:Date:Cc:Message-Id:References:To:X-Mailer; b=FOeuer13n4WoMOS4xu6QPuFRc8AlIjAGgtM8L5bIg4T0iplmRsspC08TSB2v2FiZ7/HiEgKilWuYvNoqZ2sb81aE2HvjkhMRYwt97NC38Dkg13xF/JtpMcXvUZvlxMaXyW+Q9sy0bRtc88s5IgCow9R+EDdggDF9c/XkwxWK7XkkfGUmnovovgVYsPO1nlrvI9dTVlfgtNbWHi/7rQmXrVU4hvryzdRWJ75oe3iy8UTJ1j3wgaltyOHancWhQHpsY87K4NqFGKPtZkA4+v7XvT4Zzf7twipOopM664xTmI6S5ypDzsEsu6eFfYc/VVEtbjzO9oiCJCnfV9bH56m2LQ== DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s2048; d=yahoo.com; b=jDbQEanpMRmg2VG4qOPo4USm4BL3O7GtdFKTfGJ6GeRqPIvGO8M1ojOxBEBdCZsTSetICq1kYD8ESpamAd4xHNT4SOUL6sXqZ+1xRfxZ2hrV5Wy9vDhNsfM8b8VgWTRuMBEQyf86zh1XNrxkKSgsGYZPCSDclncmiS9jZ4dnFM3yfZEbmJKaAaJBe1EjxbqMt7wNgrHJW/ZFViBN71imDzYP2HSC9dXaVKHU6o83OzPxu/zZqlNH/2+rFxQPZ35L8cmVhzV8nKMdaL6o0mgofWS9PSXAyIT/0vRFPzmMl8/RKr8YZ4h0Ff9lw5ltZGvRwt5v+6oxc0N1XAd8AAnRHg==; Received: from [98.139.215.142] by nm21.bullet.mail.bf1.yahoo.com with NNFMP; 21 Jun 2014 06:06:07 -0000 Received: from [98.139.211.196] by tm13.bullet.mail.bf1.yahoo.com with NNFMP; 21 Jun 2014 06:06:07 -0000 Received: from [127.0.0.1] by smtp205.mail.bf1.yahoo.com with NNFMP; 21 Jun 2014 06:06:07 -0000 X-Yahoo-Newman-Id: 373701.91850.bm@smtp205.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: liHOSqoVM1mNjNTZqvQeUWkXFsdH7gYsVC4QimmpYNzT7uL _REAicS2iIielH2fBRo79N52CmjqwaGaB60Z1gZAA7vWmhULw.bPmRDdNACx ZYOJwLBuzWy63TNx8glQumbK.x83snih1D3bfyp2.oIKAVzE6Wx.ah6IUeCa BGpNVLWp0KzNj_nO99Psdhisax4.ZUstMbk0KPwlaj66gWbZJ5Us0pHxGkTP czQtMlpLGhmwS271Cms27SRJ7a4Y81VQUozXXjM7NJYvyDaUcFkbLFig5Csc UJQX4dMMBWYhaKM2hkBjS2PGeSa6g5OpowuGmOS4NeAnwZ0lWZeD7znkJ1cP RCsa4dAZ1wbGT1m8kTdLI6JXW0kDo9e13PYdFTSShNDU6ue3j6IJlpXb4M1m Hw55yil1aHKxeX2R71JsvSYys1Uj1ZDxIXPi9HFBU4VJzxAcMYzGOsCDyjbr yKDPpFnR2GpNgYjGBc5VGzVBbWaBLSn0YskG3g6k.Mv7k0QSjK4VPBN3m7Yk vCY.o1dyOr65bYqbL39SSi2Fm6QjeM1UoFQfCKO8PmbvpVmQULU0nQMWeIoH Iu07JVGR0c.0eyJa.AVfdR6Z6mhXgWKuwNdBMii8lGDAbBJ1avUsX7gPPsfR wM5Mi X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf X-Rocket-Received: from [192.168.0.101] (pfg@190.157.126.109 with plain [63.250.193.228]) by smtp205.mail.bf1.yahoo.com with SMTP; 20 Jun 2014 23:06:07 -0700 PDT Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.2\)) Subject: Re: svn commit: r267692 - head/usr.bin/sed From: Pedro Giffuni In-Reply-To: <20140621054744.GN3991@kib.kiev.ua> Date: Sat, 21 Jun 2014 01:06:02 -0500 Message-Id: References: <201406202141.s5KLfU2J047433@svn.freebsd.org> <20140621054744.GN3991@kib.kiev.ua> To: Konstantin Belousov X-Mailer: Apple Mail (2.1878.2) Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.18 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Jun 2014 06:06:15 -0000 Il giorno 21/giu/2014, alle ore 00:47, Konstantin Belousov = ha scritto: > 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) >=20 > Why doing it that way ? IMO the conditional is useless and even wrong. > FreeBSD provides the _IONBF, _IONBF is required by C99. >=20 > If some other system lacks _IONBF, it should get compiler error = instead > of silently accepting non-working code. I was just trying to keep the code somewhat in sync with NetBSD: as of = lately their emphasis is portability and for them it=92s important to be = build all their system in weird platforms. I agree it=92s ugly though, so unless someone thinks we should care I = will clean it up :). Pedro.=