From e0c6851980806f2a51b37e3e37fc9a48420a4a83 Mon Sep 17 00:00:00 2001 From: "Gabriel F. T. Gomes" Date: Mon, 31 Oct 2016 22:09:12 -0200 Subject: Write messages to stdout and use write_message instead of write Replaces calls to write on file descriptor 2 with calls to write_message, which writes to STDOUT_FILENO (1) and properly deals with the return of write. --- nptl/tst-stdio2.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'nptl/tst-stdio2.c') diff --git a/nptl/tst-stdio2.c b/nptl/tst-stdio2.c index 6168d27..e0148c9 100644 --- a/nptl/tst-stdio2.c +++ b/nptl/tst-stdio2.c @@ -23,6 +23,11 @@ #include +static int do_test (void); + +#define TEST_FUNCTION do_test () +#include "../test-skeleton.c" + static void *tf (void *a) { puts ("start tf"); @@ -55,7 +60,7 @@ do_test (void) if (pthread_create (&th, NULL, tf, NULL) != 0) { - write (2, "create failed\n", 14); + write_message ("create failed\n"); _exit (1); } @@ -75,7 +80,3 @@ do_test (void) return 0; } - - -#define TEST_FUNCTION do_test () -#include "../test-skeleton.c" -- cgit v1.1