From 8022fc7d5119a22e9e0ac72798f649385b0e167a Mon Sep 17 00:00:00 2001 From: Frédéric Bérat Date: Wed, 14 Jun 2023 10:52:07 +0200 Subject: 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 --- nptl/tst-cancel7.c | 3 ++- nptl/tst-stackguard1.c | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'nptl') diff --git a/nptl/tst-cancel7.c b/nptl/tst-cancel7.c index 2835613a9b..ef9e11ce58 100644 --- a/nptl/tst-cancel7.c +++ b/nptl/tst-cancel7.c @@ -43,7 +43,8 @@ tf (void *arg) { char *cmd = xasprintf ("%s --direct --sem %s --pidfile %s", command, semfilename, pidfilename); - system (cmd); + if (system (cmd)) + FAIL_EXIT1("system call unexpectedly returned"); /* This call should never return. */ return NULL; } diff --git a/nptl/tst-stackguard1.c b/nptl/tst-stackguard1.c index 4ac57157e9..7308b9d37a 100644 --- a/nptl/tst-stackguard1.c +++ b/nptl/tst-stackguard1.c @@ -28,6 +28,7 @@ #include #include +#include static const char *command; static bool child; @@ -140,7 +141,8 @@ do_test (void) dup2 (fds[1], 2); close (fds[1]); - system (command); + xsystem (command); + exit (0); } -- cgit v1.2.3-70-g09d2