This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] test-skeleton.c: Use stdout for error messages
- From: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: Siddhesh Poyarekar <siddhesh at redhat dot com>
- Cc: Will Newton <will dot newton at linaro dot org>, <libc-alpha at sourceware dot org>
- Date: Thu, 19 Jun 2014 21:49:31 +0000
- Subject: Re: [PATCH] test-skeleton.c: Use stdout for error messages
- Authentication-results: sourceware.org; auth=none
- References: <1397227769-7214-1-git-send-email-will dot newton at linaro dot org> <20140411172556 dot GO25518 at spoyarek dot pnq dot redhat dot com>
On Fri, 11 Apr 2014, Siddhesh Poyarekar wrote:
> > diff --git a/test-skeleton.c b/test-skeleton.c
> > index d7d2f75..dd7de8b 100644
> > --- a/test-skeleton.c
> > +++ b/test-skeleton.c
> > @@ -160,7 +160,7 @@ signal_handler (int sig __attribute__ ((unused)))
> > }
> > if (killed != 0 && killed != pid)
> > {
> > - perror ("Failed to kill test process");
> > + printf ("Failed to kill test process: %s\n", strerror (errno));
>
> You could just use %m here. Likewise for other instances of strerror.
Agreed.
> > if (killed == 0 || (WIFSIGNALED (status) && WTERMSIG (status) == SIGKILL))
> > - fputs ("Timed out: killed the child process\n", stderr);
> > + puts ("Timed out: killed the child process\n");
puts outputs a newline implicitly, so when converting to puts you should
remove the \n from the string.
> This looks good to me with the above changes, but I think a senior
> maintainer should review this as well before it goes in.
The patch is OK with the requested changes.
--
Joseph S. Myers
joseph@codesourcery.com