From: Florian Weimer <fweimer@redhat.com>
To: Andreas Schwab <schwab@linux-m68k.org>, DJ Delorie <dj@redhat.com>
Cc: libc-alpha@sourceware.org
Subject: Re: RFC V2 [1/2] test-in-container
Date: Wed, 28 Feb 2018 13:49:44 +0100 [thread overview]
Message-ID: <a5e758e3-1833-28e6-2dd2-fe22f2cff6ea@redhat.com> (raw)
In-Reply-To: <877eqykulm.fsf@linux-m68k.org>
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
next prev parent reply other threads:[~2018-02-28 12:47 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-27 20:33 RFC V2 [1/2] test-in-container DJ Delorie
2018-02-27 21:09 ` Andreas Schwab
2018-02-27 21:17 ` DJ Delorie
2018-02-28 12:49 ` Florian Weimer [this message]
2018-02-28 15:04 ` Andreas Schwab
2018-02-28 12:56 ` Florian Weimer
2018-02-28 12:57 ` Florian Weimer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/libc/involved.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=a5e758e3-1833-28e6-2dd2-fe22f2cff6ea@redhat.com \
--to=fweimer@redhat.com \
--cc=dj@redhat.com \
--cc=libc-alpha@sourceware.org \
--cc=schwab@linux-m68k.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).