This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH v2] test-skeleton: redirect stderr to stdout
- From: Arjun Shankar <arjun dot is at lostca dot se>
- To: Mike Frysinger <vapier at gentoo dot org>
- Cc: libc-alpha at sourceware dot org, Roland McGrath <roland at hack dot frob dot com>
- Date: Fri, 17 Jun 2016 15:34:32 +0000
- Subject: Re: [PATCH v2] test-skeleton: redirect stderr to stdout
- Authentication-results: sourceware.org; auth=none
- References: <1466052483-27705-1-git-send-email-vapier at gentoo dot org> <1466141361-4765-1-git-send-email-vapier at gentoo dot org>
> 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