From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 127170 invoked by alias); 1 Nov 2016 00:44:08 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 127149 invoked by uid 89); 1 Nov 2016 00:44:07 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.1 required=5.0 tests=BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_LOW,RCVD_IN_SEMBACKSCATTER autolearn=no version=3.3.2 spammy=handler, 2512, sem X-HELO: mx0a-001b2d01.pphosted.com From: "Gabriel F. T. Gomes" To: libc-alpha@sourceware.org Cc: fweimer@redhat.com Subject: [PATCH 1/2] Use write_message instead of write Date: Tue, 01 Nov 2016 00:44:00 -0000 In-Reply-To: <1477961028-12150-1-git-send-email-gftg@linux.vnet.ibm.com> References: <1477961028-12150-1-git-send-email-gftg@linux.vnet.ibm.com> X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16110100-0024-0000-0000-0000011F58A7 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16110100-0025-0000-0000-000015DD0C06 Message-Id: <1477961028-12150-2-git-send-email-gftg@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-10-31_09:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=1 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1609300000 definitions=main-1611010010 X-SW-Source: 2016-11/txt/msg00000.txt.bz2 In the test cases, there are writes to stdout which do not check the result value. This patch replaces such occurrences with calls to write_message, which properly deals with the unused result. 2016-10-28 Gabriel F. T. Gomes * nptl/tst-kill3.c (handler): Use write_message in place of write. * nptl/tst-kill6.c (handler): Likewise. * nptl/tst-tls2.c (CB): Likewise. * nptl/tst-tls3.c (CB): Likewise. --- nptl/tst-kill3.c | 13 +++++++------ nptl/tst-kill6.c | 15 ++++++++------- nptl/tst-tls2.c | 15 ++++++++------- nptl/tst-tls3.c | 13 +++++++------ 4 files changed, 30 insertions(+), 26 deletions(-) diff --git a/nptl/tst-kill3.c b/nptl/tst-kill3.c index 308cc5a..86f3c6c 100644 --- a/nptl/tst-kill3.c +++ b/nptl/tst-kill3.c @@ -25,6 +25,12 @@ #include +static int do_test (void); + +#define TIMEOUT 5 +#define TEST_FUNCTION do_test () +#include "../test-skeleton.c" + static pthread_cond_t c = PTHREAD_COND_INITIALIZER; static pthread_mutex_t m = PTHREAD_MUTEX_INITIALIZER; static pthread_barrier_t b; @@ -33,7 +39,7 @@ static pthread_barrier_t b; static void handler (int sig) { - write (1, "handler called\n", 15); + write_message ("handler called\n"); _exit (1); } @@ -151,8 +157,3 @@ do_test (void) return 0; } - - -#define TIMEOUT 5 -#define TEST_FUNCTION do_test () -#include "../test-skeleton.c" diff --git a/nptl/tst-kill6.c b/nptl/tst-kill6.c index 80a0771..2a9add2 100644 --- a/nptl/tst-kill6.c +++ b/nptl/tst-kill6.c @@ -25,6 +25,11 @@ #include +static int do_test (void); + +#define TEST_FUNCTION do_test () +#include "../test-skeleton.c" + static pthread_t receiver; static sem_t sem; static pthread_barrier_t b; @@ -34,19 +39,19 @@ handler (int sig) { if (sig != SIGUSR1) { - write (STDOUT_FILENO, "wrong signal\n", 13); + write_message ("wrong signal\n"); _exit (1); } if (pthread_self () != receiver) { - write (STDOUT_FILENO, "not the intended receiver\n", 26); + write_message ("not the intended receiver\n"); _exit (1); } if (sem_post (&sem) != 0) { - write (STDOUT_FILENO, "sem_post failed\n", 16); + write_message ("sem_post failed\n"); _exit (1); } } @@ -155,7 +160,3 @@ do_test (void) return 0; } - - -#define TEST_FUNCTION do_test () -#include "../test-skeleton.c" diff --git a/nptl/tst-tls2.c b/nptl/tst-tls2.c index eb6d8a3..054ab80 100644 --- a/nptl/tst-tls2.c +++ b/nptl/tst-tls2.c @@ -29,13 +29,18 @@ static pthread_t th[N]; +static int do_test (void); + +#define TEST_FUNCTION do_test () +#include "../test-skeleton.c" + #define CB(n) \ static void \ cb##n (void) \ { \ if (th[n] != pthread_self ()) \ { \ - write (STDOUT_FILENO, "wrong callback\n", 15); \ + write_message ("wrong callback\n"); \ _exit (1); \ } \ } @@ -67,7 +72,7 @@ handler (int sig) { if (sig != THE_SIG) { - write (STDOUT_FILENO, "wrong signal\n", 13); + write_message ("wrong signal\n"); _exit (1); } @@ -75,7 +80,7 @@ handler (int sig) if (sem_post (&s) != 0) { - write (STDOUT_FILENO, "sem_post failed\n", 16); + write_message ("sem_post failed\n"); _exit (1); } } @@ -199,7 +204,3 @@ do_test (void) return 0; } - - -#define TEST_FUNCTION do_test () -#include "../test-skeleton.c" diff --git a/nptl/tst-tls3.c b/nptl/tst-tls3.c index 649cb8f..4b96974 100644 --- a/nptl/tst-tls3.c +++ b/nptl/tst-tls3.c @@ -39,13 +39,19 @@ static long stack_size_in_mb; static pthread_t th[N]; +static int do_test (void); + +#define TIMEOUT 5 +#define TEST_FUNCTION do_test () +#include "../test-skeleton.c" + #define CB(n) \ static void \ cb##n (void) \ { \ if (th[n] != pthread_self ()) \ { \ - write (STDOUT_FILENO, "wrong callback\n", 15); \ + write_message ("wrong callback\n"); \ _exit (1); \ } \ } @@ -207,8 +213,3 @@ do_test (void) return 0; } - - -#define TIMEOUT 5 -#define TEST_FUNCTION do_test () -#include "../test-skeleton.c" -- 2.4.11