[PATCH] test-skeleton.c: Use stdout for error messages
Joseph S. Myers
joseph@codesourcery.com
Thu Jun 19 21:49:00 GMT 2014
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
More information about the Libc-alpha
mailing list