]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Linux: Terminate subprocess on late failure in tst-pidfd (bug 29485)
authorFlorian Weimer <fweimer@redhat.com>
Mon, 15 Aug 2022 14:43:59 +0000 (16:43 +0200)
committerFlorian Weimer <fweimer@redhat.com>
Mon, 15 Aug 2022 14:43:59 +0000 (16:43 +0200)
Reviewed-by: Carlos O'Donell <carlos@redhat.com>
sysdeps/unix/sysv/linux/tst-pidfd.c

index 037af22290a76ac6eb75cc87d2aba5d7e214cb38..5711d1c312948ca0f1436bfb08bcc5e40cdcec09 100644 (file)
@@ -147,8 +147,11 @@ do_test (void)
        may be denied if the process doesn't have CAP_SYS_PTRACE or
        if a LSM security_ptrace_access_check denies access.  */
     if (fd == -1 && errno == EPERM)
-      FAIL_UNSUPPORTED ("don't have permission to use pidfd_getfd on pidfd, "
-                       "skipping test");
+      {
+       TEST_COMPARE (pidfd_send_signal (pidfd, SIGKILL, NULL, 0), 0);
+       FAIL_UNSUPPORTED ("don't have permission to use pidfd_getfd on pidfd, "
+                         "skipping test");
+      }
     TEST_VERIFY (fd > 0);
 
     char *path = xasprintf ("/proc/%d/fd/%d", pid, remote_fd);