public inbox for glibc-cvs@sourceware.org help / color / mirror / Atom feed
From: Siddhesh Poyarekar <siddhesh@sourceware.org> To: glibc-cvs@sourceware.org Subject: [glibc] benchtests: fix warn unused result Date: Thu, 22 Jun 2023 04:54:02 +0000 (GMT) [thread overview] Message-ID: <20230622045402.36E25385841D@sourceware.org> (raw) https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=99f9ae4ed0ba9f2c84520b78fd0eeed96a7ed40e commit 99f9ae4ed0ba9f2c84520b78fd0eeed96a7ed40e Author: Frederic Berat <fberat@redhat.com> 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 <siddhesh@sourceware.org> 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 <sys/types.h> #include <sys/uio.h> #include <elf.h> +#include <support/xstdlib.h> #include <support/xunistd.h> #include <support/check.h> #include <string.h> @@ -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);
reply other threads:[~2023-06-22 4:54 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20230622045402.36E25385841D@sourceware.org \ --to=siddhesh@sourceware.org \ --cc=glibc-cvs@sourceware.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).