aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/unix
diff options
context:
space:
mode:
authorFlorian Weimer <fweimer@redhat.com>2022-08-15 16:43:59 +0200
committerFlorian Weimer <fweimer@redhat.com>2022-08-16 07:30:25 +0200
commite982657073c4db21459ffd9e17bc505b1d64b876 (patch)
tree29f6eb69b674414432379d12c6ef5c4709c0847b /sysdeps/unix
parent302bc33bc53c787da6e74162a7092e9c0fb964a8 (diff)
downloadglibc-e982657073c4db21459ffd9e17bc505b1d64b876.zip
glibc-e982657073c4db21459ffd9e17bc505b1d64b876.tar.gz
glibc-e982657073c4db21459ffd9e17bc505b1d64b876.tar.bz2
Linux: Terminate subprocess on late failure in tst-pidfd (bug 29485)
Reviewed-by: Carlos O'Donell <carlos@redhat.com> (cherry picked from commit f82e05ebb295cadd35f7372f652c72264da810ad)
Diffstat (limited to 'sysdeps/unix')
-rw-r--r--sysdeps/unix/sysv/linux/tst-pidfd.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/sysdeps/unix/sysv/linux/tst-pidfd.c b/sysdeps/unix/sysv/linux/tst-pidfd.c
index 037af22..5711d1c 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);