From: Andreas Schwab <schwab@linux-m68k.org>
To: DJ Delorie <dj@redhat.com>
Cc: libc-alpha@sourceware.org
Subject: Re: RFC V2 [1/2] test-in-container
Date: Tue, 27 Feb 2018 22:09:41 +0100 [thread overview]
Message-ID: <877eqykulm.fsf@linux-m68k.org> (raw)
In-Reply-To: <xnwoyyrx3c.fsf@greed.delorie.com> (DJ Delorie's message of "Tue, 27 Feb 2018 15:33:59 -0500")
On Feb 27 2018, DJ Delorie <dj@redhat.com> 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."
next prev parent reply other threads:[~2018-02-27 21:07 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 [this message]
2018-02-27 21:17 ` DJ Delorie
2018-02-28 12:49 ` Florian Weimer
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=877eqykulm.fsf@linux-m68k.org \
--to=schwab@linux-m68k.org \
--cc=dj@redhat.com \
--cc=libc-alpha@sourceware.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).