This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[PATCH] test-skeleton: redirect stderr to stdout
- From: Mike Frysinger <vapier at gentoo dot org>
- To: libc-alpha at sourceware dot org
- Date: Thu, 16 Jun 2016 00:48:03 -0400
- Subject: [PATCH] test-skeleton: redirect stderr to stdout
- Authentication-results: sourceware.org; auth=none
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.
---
test-skeleton.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/test-skeleton.c b/test-skeleton.c
index a9ad4ab7e9c6..3ff55810f0ec 100644
--- a/test-skeleton.c
+++ b/test-skeleton.c
@@ -343,6 +343,10 @@ main (int argc, char *argv[])
setbuf (stdout, NULL);
#endif
+ fclose (stderr);
+ dup2 (STDOUT_FILENO, STDERR_FILENO);
+ stderr = fdopen (STDERR_FILENO, "w");
+
while ((opt = getopt_long (argc, argv, "+", options, NULL)) != -1)
switch (opt)
{
--
2.8.2