diff options
author | Frédéric Bérat <fberat@redhat.com> | 2023-06-14 10:52:07 +0200 |
---|---|---|
committer | Siddhesh Poyarekar <siddhesh@sourceware.org> | 2023-06-19 09:15:05 -0400 |
commit | 8022fc7d5119a22e9e0ac72798f649385b0e167a (patch) | |
tree | f2cdb5c88d14c05e96395f0cdc99a6692ec0f8da /libio | |
parent | 20b6b8e8a50874dd189687df8f6f8a11d4813b34 (diff) | |
download | glibc-8022fc7d5119a22e9e0ac72798f649385b0e167a.zip glibc-8022fc7d5119a22e9e0ac72798f649385b0e167a.tar.gz glibc-8022fc7d5119a22e9e0ac72798f649385b0e167a.tar.bz2 |
tests: replace system by xsystem
With fortification enabled, system calls return result needs to be checked,
has it gets the __wur macro enabled.
Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
Diffstat (limited to 'libio')
-rw-r--r-- | libio/bug-mmap-fflush.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/libio/bug-mmap-fflush.c b/libio/bug-mmap-fflush.c index d8aa589..3f99222 100644 --- a/libio/bug-mmap-fflush.c +++ b/libio/bug-mmap-fflush.c @@ -4,6 +4,7 @@ #include <stdlib.h> #include <string.h> +#include <support/xstdlib.h> static char *fname; @@ -35,14 +36,16 @@ do_test (void) char buffer[1024]; snprintf (buffer, sizeof (buffer), "echo 'From foo@bar.com' > %s", fname); - system (buffer); + xsystem (buffer); + f = fopen (fname, "r"); fseek (f, 0, SEEK_END); o = ftello (f); fseek (f, 0, SEEK_SET); fflush (f); snprintf (buffer, sizeof (buffer), "echo 'From bar@baz.edu' >> %s", fname); - system (buffer); + xsystem (buffer); + fseek (f, o, SEEK_SET); if (fgets (buffer, 1024, f) == NULL) exit (1); |