]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
elf: Fix subprocess status handling for tst-dlopen-sgid (bug 32987)
authorFlorian Weimer <fweimer@redhat.com>
Wed, 21 May 2025 06:43:32 +0000 (08:43 +0200)
committerFlorian Weimer <fweimer@redhat.com>
Wed, 21 May 2025 06:43:32 +0000 (08:43 +0200)
This should really move into support_capture_subprogram_self_sgid.

Reviewed-by: Sam James <sam@gentoo.org>
elf/tst-dlopen-sgid.c

index 47829a405e90b6b92fb7932f47dc178ee18c51b6..5688b79f2e870b1dd4dd66c098f03632a0afccc0 100644 (file)
@@ -26,6 +26,8 @@
 #include <support/check.h>
 #include <support/support.h>
 #include <support/temp_file.h>
+#include <support/test-driver.h>
+#include <sys/wait.h>
 #include <unistd.h>
 
 /* This is the name of our test object.  Use a custom module for
@@ -66,10 +68,16 @@ do_test (void)
     free (from);
   }
 
-  TEST_COMPARE (support_capture_subprogram_self_sgid (magic_argument), 0);
-
   free (libdir);
 
+  int status = support_capture_subprogram_self_sgid (magic_argument);
+
+  if (WEXITSTATUS (status) == EXIT_UNSUPPORTED)
+    return EXIT_UNSUPPORTED;
+
+  if (!WIFEXITED (status))
+    FAIL_EXIT1 ("Unexpected exit status %d from child process\n", status);
+
   return 0;
 }