From owner-svn-src-all@freebsd.org  Thu Mar  9 18:18:58 2017
Return-Path: <owner-svn-src-all@freebsd.org>
Delivered-To: svn-src-all@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8D4CED050D4
 for <svn-src-all@mailman.ysv.freebsd.org>;
 Thu,  9 Mar 2017 18:18:58 +0000 (UTC) (envelope-from pfg@FreeBSD.org)
Received: from nm14-vm3.bullet.mail.ne1.yahoo.com
 (nm14-vm3.bullet.mail.ne1.yahoo.com [98.138.91.144])
 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 5825B13C8
 for <svn-src-all@freebsd.org>; Thu,  9 Mar 2017 18:18:58 +0000 (UTC)
 (envelope-from pfg@FreeBSD.org)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048;
 t=1489083531; bh=OuPV2USQmHq0NhNFVANVnjkf8g1qVhEfXwfZKGmvU/g=;
 h=Subject:To:References:Cc:From:Date:In-Reply-To:From:Subject;
 b=JVYmoSxIuK0LVmEzupRRKJqrWWrqq4jy+YAiFBlftk4oPRxH6aZeqTx2armmhJL3NxpR9WHk/5K28GoIkuCVEDMGu6G58NBSgsvAfqaQLN2+mmOlQmM1r/+U0Kl6hxmGGjAW30aELhZSvNNZ+EUnKSWUjxQ1yAWvpuV38fvPKnuoVrECDpPsyf9NshbE83IIiTAZwmIDy4T/MTvz0T3PoHzmrMI4J26YNfvXjvpw2FZZDtKR8vwkoDkZT266+ssODEmQhZOUBoLWPm6fqq/+xmmnSUKa4O3n+KsaGoAgg3yjsRSsWM2siP1szRG4I0sIOBvSPwWoixQVDHaguB2EHA==
Received: from [98.138.100.115] by nm14.bullet.mail.ne1.yahoo.com with NNFMP;
 09 Mar 2017 18:18:51 -0000
Received: from [98.138.104.115] by tm106.bullet.mail.ne1.yahoo.com with NNFMP;
 09 Mar 2017 18:18:51 -0000
Received: from [127.0.0.1] by smtp224.mail.ne1.yahoo.com with NNFMP;
 09 Mar 2017 18:18:51 -0000
X-Yahoo-Newman-Id: 30006.18052.bm@smtp224.mail.ne1.yahoo.com
X-Yahoo-Newman-Property: ymail-3
X-YMail-OSG: ZoX.3ncVM1lOanr0zl09x2fsqxSepeSeGoWrosdPsZ0gZlX
 xd7TMsutYzQXXjy9.HG6vsGYdI231dx2svyWbv3oHZF36d4N0q4bc46110AX
 intq29MKntUVnfte5w0cqrB0UGAmbQtaaiDmjUxdCiaO_1D52UgnE8wV.ZM8
 CNSUvalstQhyVdE1BU6VNsqnIO0mTty3M2K.6dyHjDzcMmrSMBQeFhkPlrEV
 hrVh8j2unvKiTtmx7lXiWqLVQ31JR6qBnlEx40B1gQ6Bq_nLmFSHY1c4WOTg
 qdpZwzNPaCsteaMuaBBp.wRqwRLyFfPFgEtYtNKDK.VCNfPobDt3WKCyZYLo
 mwx7SOvQjSaECdFzR_4JiCf25koE5Lu8P75tNDY_TAvt6EqCW7ERzKlXFw2x
 NILtqM3bkG8ulhY_D1caJ0CDp8lxqIVTe2C6HA9yxSWzJxmfvqELd2adsFq4
 wiUF4XqRei8JBNW9I.VmsjBPuOacJ7FzznntHAi3RtQB2udnG_9E2xedaSAE
 f6gN6fCWkbTpOoAsLl4BjQS.dL7cGcvTWX5Zb07h3Gu7D6Mk-
X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf
Subject: Re: svn commit: r314969 - head/usr.bin/localedef
To: Konstantin Belousov <kostikbel@gmail.com>
References: <201703091806.v29I6mNx080192@repo.freebsd.org>
 <20170309181124.GF16105@kib.kiev.ua>
Cc: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
From: Pedro Giffuni <pfg@FreeBSD.org>
Message-ID: <3612f18f-4389-87b0-d118-90a9934c745a@FreeBSD.org>
Date: Thu, 9 Mar 2017 13:21:51 -0500
User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:45.0) Gecko/20100101
 Thunderbird/45.7.1
MIME-Version: 1.0
In-Reply-To: <20170309181124.GF16105@kib.kiev.ua>
Content-Type: text/plain; charset=windows-1252; format=flowed
Content-Transfer-Encoding: 7bit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: "SVN commit messages for the entire src tree \(except for &quot;
 user&quot; and &quot; projects&quot; \)" <svn-src-all.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/>
List-Post: <mailto:svn-src-all@freebsd.org>
List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>,
 <mailto:svn-src-all-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Thu, 09 Mar 2017 18:18:58 -0000

Hello;


On 3/9/2017 1:11 PM, Konstantin Belousov wrote:
> On Thu, Mar 09, 2017 at 06:06:48PM +0000, Pedro F. Giffuni wrote:
>> Author: pfg
>> Date: Thu Mar  9 18:06:48 2017
>> New Revision: 314969
>> URL: https://svnweb.freebsd.org/changeset/base/314969
>>
>> Log:
>>    localedef(1): Fix mismatch in previous commit.
>>    
>>    delete_category is meant to replace fclose() and unlink().
>>    This broke world.
>>    
>>    Found by:	kib
>>    Pointedhat:	pfg
>>
>> Modified:
>>    head/usr.bin/localedef/localedef.c
>>
>> Modified: head/usr.bin/localedef/localedef.c
>> ==============================================================================
>> --- head/usr.bin/localedef/localedef.c	Thu Mar  9 17:53:37 2017	(r314968)
>> +++ head/usr.bin/localedef/localedef.c	Thu Mar  9 18:06:48 2017	(r314969)
>> @@ -137,8 +137,6 @@ close_category(FILE *f)
>>   {
>>   	if (fchmod(fileno(f), 0644) < 0 ||
>>   	    fclose(f) != 0) {
>> -		(void) fclose(f);
>> -		(void) unlink(category_file());
>>   		errf(strerror(errno));
>>   		delete_category(f);
>>   	}
> I still think that the fclose() call in the condition is also excessive.
Huge thanks for reporting all this.

I agree ... tha fclose() is also in illumos so I will see with them.

Thanks again,

Pedro.