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 v2] test-skeleton: redirect stderr to stdout


> Rather than worry if we use funcs that dirty stderr instead of writing
> to stdout, redirect stderr internally to stdout.  Now all output will
> go to stdout regardless.

> +  if (dup2 (STDOUT_FILENO, STDERR_FILENO) == -1)
> +    {
> +      printf ("binding stderr to stdout failed: %m\n");
> +      exit (1);
> +    }

Just want to mention this somewhat old but related thread:

https://sourceware.org/ml/libc-alpha/2014-10/msg00089.html

In short:
While I am not aware of any test that _requires_ writes to stderr, this
blanket `dup2' in the skeleton can affect such tests. Roland mentioned that
for such tests, if they show up, this behaviour can be made to depend on a
macro. I don't know if including a `#ifdef' in this first patch is good
since it probably will remain unused for now, but it's an idea.

Cheers,
Arjun


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