From owner-svn-src-head@freebsd.org Wed Mar 30 10:10:14 2016 Return-Path: Delivered-To: svn-src-head@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 5FDC0AE2570 for ; Wed, 30 Mar 2016 10:10:14 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: from mail-lf0-f51.google.com (mail-lf0-f51.google.com [209.85.215.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E9C291C9B for ; Wed, 30 Mar 2016 10:10:13 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: by mail-lf0-f51.google.com with SMTP id k79so32154197lfb.2 for ; Wed, 30 Mar 2016 03:10:13 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=rC/cpt1whxxiQYEP0Rz63WIdXQD33f7pW4UhD6YXWPc=; b=LJPizehbaRyOrUbXuWDDyPmPSgU70kOjYvrp+HKutcYHgy1dX2QcvLSZcFzYt1rJ61 CeOru0VUPNWlI7SLTHwVdh8xHLTZdrbjkNX/xFurDqzt8Dfr0eFPXzcf+eoDcpEF4TCa X+cjKWI06lAvJ/mhbW/2OE2A+1vV3OOzOzb6V6td9wxDk+AhpuHYS1eHK9Wr+5HfeHho SCC5ODviShpW7qm2OaLUpWpuvUZt7CdFWezPheWKqPVKQYau6uWZT91M/dWIrXNgaL9a enOn8A8eroliQXfwtZCHY4yxRyBPsg8JP1YhREDI/QSl7YzMTUvdY+sr4bK2CbsoRcJX xY8A== X-Gm-Message-State: AD7BkJLdaJu204p/ffGmWAhJk+YG09daA7YqlR+KdNgYhLpJptcbo/e3apaq95ci5icpOQ== X-Received: by 10.25.17.67 with SMTP id g64mr3514920lfi.112.1459332116185; Wed, 30 Mar 2016 03:01:56 -0700 (PDT) Received: from [192.168.1.2] ([89.169.173.68]) by smtp.gmail.com with ESMTPSA id ke9sm473643lbc.28.2016.03.30.03.01.55 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 30 Mar 2016 03:01:55 -0700 (PDT) Subject: Re: svn commit: r297408 - head/lib/libc/stdio To: "Pedro F. Giffuni" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201603300613.u2U6DwGv026746@repo.freebsd.org> From: Andrey Chernov Message-ID: <56FBA412.5010301@freebsd.org> Date: Wed, 30 Mar 2016 13:01:54 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.7.0 MIME-Version: 1.0 In-Reply-To: <201603300613.u2U6DwGv026746@repo.freebsd.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 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: Wed, 30 Mar 2016 10:10:14 -0000 On 30.03.2016 9:13, Pedro F. Giffuni wrote: > */ > + sverrno = 0; > if (file == NULL) { It introduces the bug of touching errno. Previous code does it right because 'goto finish;' can't happen with (f < 0) where errno is restored later. The whole errno code is complex here for reading at least. It microoptimize errno handling by removing unnecessary assignment, but it does not gain much in reality. Better change for easy reading will be to set sverrno = errno; once right at the function enter and remove it in all other places. In any case errno touching should be backed out. -- http://ache.vniz.net/