From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2206) id 36E25385841D; Thu, 22 Jun 2023 04:54:02 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 36E25385841D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1687409642; bh=sX9zTPZznpesezXZblAbkW1TKySU0k0vRICHJ7EO6y4=; h=From:To:Subject:Date:From; b=dh9fWrY9tOtDszDex4OLZvqZWOCIQEqqbodnF5JwSOfTUf3RXt7uUI2cyQ/BNulkC DSJVaP0FZnSdKdli9rIl7cT53Ha4Ld/yQjupc6ZAb+U8soezsH2sjR0Eh11fGH5dzj OLWXQfcJWi0QuB5fiFADVqT+mkcSs0lCRqoVrz/4= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Siddhesh Poyarekar To: glibc-cvs@sourceware.org Subject: [glibc] benchtests: fix warn unused result X-Act-Checkin: glibc X-Git-Author: Frederic Berat X-Git-Refname: refs/heads/master X-Git-Oldrev: d636339306d19beb486d6f3a0b364db845baf4e0 X-Git-Newrev: 99f9ae4ed0ba9f2c84520b78fd0eeed96a7ed40e Message-Id: <20230622045402.36E25385841D@sourceware.org> Date: Thu, 22 Jun 2023 04:54:02 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=99f9ae4ed0ba9f2c84520b78fd0eeed96a7ed40e commit 99f9ae4ed0ba9f2c84520b78fd0eeed96a7ed40e Author: Frederic Berat Date: Tue Jun 20 20:19:09 2023 +0200 benchtests: fix warn unused result Few tests needed to properly check for asprintf and system calls return values with _FORTIFY_SOURCE enabled. Reviewed-by: Siddhesh Poyarekar Diff: --- benchtests/bench-strcoll.c | 6 +++++- sysdeps/unix/sysv/linux/s390/tst-ptrace-singleblock.c | 3 ++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/benchtests/bench-strcoll.c b/benchtests/bench-strcoll.c index b3cd5ce8a9..0bd9ada5f6 100644 --- a/benchtests/bench-strcoll.c +++ b/benchtests/bench-strcoll.c @@ -254,7 +254,11 @@ main (void) } char *filename; - asprintf (&filename, INPUT_PREFIX "%s", input_files[i]); + if (asprintf (&filename, INPUT_PREFIX "%s", input_files[i]) < 0) + { + printf ("asprintf failed, aborting!\n"); + return ERROR_FILENAME; + } result = bench_file (json_ctx, input_files[i], filename, locale + 1); if (result != OK) diff --git a/sysdeps/unix/sysv/linux/s390/tst-ptrace-singleblock.c b/sysdeps/unix/sysv/linux/s390/tst-ptrace-singleblock.c index e5cdb2b2a1..4631ec9f0b 100644 --- a/sysdeps/unix/sysv/linux/s390/tst-ptrace-singleblock.c +++ b/sysdeps/unix/sysv/linux/s390/tst-ptrace-singleblock.c @@ -24,6 +24,7 @@ #include #include #include +#include #include #include #include @@ -44,7 +45,7 @@ tracee_func (int pid) char str[80]; sprintf (str, "cat /proc/%d/maps", pid); puts (str); - system (str); + xsystem (str); fflush (stdout); TEST_VERIFY_EXIT (ptrace (PTRACE_TRACEME) == 0);