This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] test-skeleton.c: Use stdout for error messages


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]