From: Florian Weimer Date: Mon, 15 Aug 2022 14:43:59 +0000 (+0200) Subject: Linux: Terminate subprocess on late failure in tst-pidfd (bug 29485) X-Git-Tag: glibc-2.37~423 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f82e05ebb295cadd35f7372f652c72264da810ad;p=thirdparty%2Fglibc.git Linux: Terminate subprocess on late failure in tst-pidfd (bug 29485) Reviewed-by: Carlos O'Donell --- diff --git a/sysdeps/unix/sysv/linux/tst-pidfd.c b/sysdeps/unix/sysv/linux/tst-pidfd.c index 037af22290a..5711d1c3129 100644 --- a/sysdeps/unix/sysv/linux/tst-pidfd.c +++ b/sysdeps/unix/sysv/linux/tst-pidfd.c @@ -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);