From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Florian Weimer Newsgroups: gmane.comp.lib.glibc.alpha Subject: Re: RFC V2 [1/2] test-in-container Date: Wed, 28 Feb 2018 13:49:44 +0100 Message-ID: References: <877eqykulm.fsf@linux-m68k.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: blaine.gmane.org 1519822070 8217 195.159.176.226 (28 Feb 2018 12:47:50 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 28 Feb 2018 12:47:50 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 Cc: libc-alpha@sourceware.org To: Andreas Schwab , DJ Delorie Original-X-From: libc-alpha-return-90676-glibc-alpha=m.gmane.org@sourceware.org Wed Feb 28 13:47:46 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:subject:to:cc:references:from:message-id:date :mime-version:in-reply-to:content-type :content-transfer-encoding; q=dns; s=default; b=OH/emQJJEwun4Ua1 PnonFCiFHhxY7SFGcXHTAO8Wpv/s31wnzcpd9wOBYTr6GtsaZbHowtG1PXhZ8KA7 v2orBIGn/0ed3spdecfeRm2fmJq0K3r1YQu8QCE5ky63gD8s4lk2EfCpAoLEKTxE ikkANyjHETTr6rKRVOw0uKh0YlU= 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:subject:to:cc:references:from:message-id:date :mime-version:in-reply-to:content-type :content-transfer-encoding; s=default; bh=QYqyGKNB51LoojcIji4OIY +ah5Y=; b=xo7ILBqAZeiLtB3xC70tG86wD9pg45rmQUUNwzL6hy/RbWLITnbj7b wJdIENVjMwZQjNaXgB9kQ/+YEXb9ilHE079/8YGvAKYfKkeu6BxtUcb7gmVdjBxC M410L2lQyXs/KNTUFarAi929MF9TKW5DlIzpiC4MlHIEcP98RTXAw= 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=-2.1 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy=H*M:1833 X-HELO: mx1.redhat.com In-Reply-To: <877eqykulm.fsf@linux-m68k.org> Xref: news.gmane.org gmane.comp.lib.glibc.alpha:83007 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 1er197-0001Xg-Lc for glibc-alpha@blaine.gmane.org; Wed, 28 Feb 2018 13:47:45 +0100 Received: (qmail 94196 invoked by alias); 28 Feb 2018 12:49:48 -0000 Received: (qmail 94183 invoked by uid 89); 28 Feb 2018 12:49:48 -0000 On 02/27/2018 10:09 PM, Andreas Schwab 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. Doesn't error print to standard error? %m is another option. Thanks, Florian