From owner-svn-src-all@freebsd.org Wed Mar 30 10:31:06 2016 Return-Path: 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 0AA3AAE2A53 for ; Wed, 30 Mar 2016 10:31:06 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: from mail-lf0-f47.google.com (mail-lf0-f47.google.com [209.85.215.47]) (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 85E6D17D2 for ; Wed, 30 Mar 2016 10:31:04 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: by mail-lf0-f47.google.com with SMTP id c62so32527556lfc.1 for ; Wed, 30 Mar 2016 03:31:04 -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=HOyyXjJ0Fu6xTtjMYHqMb9xlRg1hhJFFS621Cnn+svuJQiEP93dxMBUNhwZKf3qHeH 1DYrvn/Y18ZthGGE6ba5+7gthn53J/7Y2trzT8LC8HELdj6wUei7fe4h5z1cKgSxVien rhMIhrpiMq4RCHPIWyq2Z/GU7wfJTOOI7D/iKhc3yoiFuQ7PIcRcCKchnnBkkv7UsP9X egFrib/1A0lbgAXfurKysUq5DOz6ihty3nsFMHk6PCF2CPQfTWiBAw8o/kTfUNYJcfRr uh+I9U77UkPuMpianKM2pQTIG6lBKUgbRnMA921nb7ZTyRtyzP5i92dz4TLK/238HNqI +JFw== X-Gm-Message-State: AD7BkJLEWwR/ufKpUtBZQpiSEDYmrjNymMMoOpIMvnU6/YnhRv8jFxRH6zerJrXVuqEohA== 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-all@freebsd.org X-Mailman-Version: 2.1.21 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: Wed, 30 Mar 2016 10:31:06 -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/