From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Andreas Schwab Newsgroups: gmane.comp.lib.glibc.alpha Subject: Re: RFC V2 [1/2] test-in-container Date: Tue, 27 Feb 2018 22:09:41 +0100 Message-ID: <877eqykulm.fsf@linux-m68k.org> References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1519765672 337 195.159.176.226 (27 Feb 2018 21:07:52 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 27 Feb 2018 21:07:52 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.91 (gnu/linux) Cc: libc-alpha@sourceware.org To: DJ Delorie Original-X-From: libc-alpha-return-90672-glibc-alpha=m.gmane.org@sourceware.org Tue Feb 27 22:07:48 2018 Return-path: Envelope-to: glibc-alpha@blaine.gmane.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:references:date:in-reply-to :message-id:mime-version:content-type; q=dns; s=default; b=Ee/5d oScqMb8TBU4Ztir6v7AoIBGSIcuFLvYS7nrzMUyWN/AZHtuE/GoCbJ1GGcRlO7KN kuSO5DVFjUGBTU5ldIGY7VTN41PwrDt1NIUH8liArJVLrlqizOT6MARPQ+l+0RaX rgk+s8rvUIrEj/VgmABYUO366E6NKbGzGBpvG4= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:references:date:in-reply-to :message-id:mime-version:content-type; s=default; bh=xnlxqVSF4C6 zu4TyM9VgowMS8NE=; b=rpxdjchbGmgL6NmNk94c9hioBINwXgypWPHSeH19K+3 3V9OFwG75BGaY38Gl9kB9OE5HNk00iXVNYcPSCWf3nA5MD5sV+k/PW32rAfczZ0x jZFS/z8+8liOurSpUaEDMeOyj6Z0LJId5yhUUNKqrm+EaFXInPtzjo3keqNStEo4 = Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Original-Sender: libc-alpha-owner@sourceware.org Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.6 required=5.0 tests=BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_LOW autolearn=no version=3.3.2 spammy= X-HELO: mail-out.m-online.net X-Auth-Info: lV/kpvlMwdFOxxNPTp6N4fnSVZq2G9dcCvE8uOwMteC17/kwD+RR2M7pVg0l6vuw X-Yow: I want DUSTIN HOFFMAN!! .. I want LIBERACE!! YOW!! In-Reply-To: (DJ Delorie's message of "Tue, 27 Feb 2018 15:33:59 -0500") Xref: news.gmane.org gmane.comp.lib.glibc.alpha:83003 Archived-At: Received: from server1.sourceware.org ([209.132.180.131] helo=sourceware.org) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eqmTT-000816-La for glibc-alpha@blaine.gmane.org; Tue, 27 Feb 2018 22:07:47 +0100 Received: (qmail 94911 invoked by alias); 27 Feb 2018 21:09:50 -0000 Received: (qmail 94559 invoked by uid 89); 27 Feb 2018 21:09:50 -0000 On Feb 27 2018, DJ Delorie wrote: > +static void > +copy_one_file (const char *sname, const char *dname) > +{ > + int sfd, dfd; > + char buf[512]; > + size_t rsz; > + struct stat st; > + struct utimbuf times; > + > + sfd = open (sname, O_RDONLY); > + if (sfd < 0) > + { > + printf ("unable to open %s for reading\n", sname); > + perror ("the error was"); That doesn't work, the printf call can clobber errno. Use error instead. Andreas. -- Andreas Schwab, schwab@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."