From: Frederic Berat Date: Tue, 20 Jun 2023 18:19:09 +0000 (+0200) Subject: benchtests: fix warn unused result X-Git-Tag: glibc-2.38~113 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=99f9ae4ed0ba9f2c84520b78fd0eeed96a7ed40e;p=thirdparty%2Fglibc.git 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 --git a/benchtests/bench-strcoll.c b/benchtests/bench-strcoll.c index b3cd5ce8a9b..0bd9ada5f61 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 e5cdb2b2a1e..4631ec9f0b5 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);