summaryrefslogtreecommitdiff
path: root/tests/lib/libc
diff options
context:
space:
mode:
authorkamil <kamil@NetBSD.org>2020-05-11 11:03:15 +0000
committerkamil <kamil@NetBSD.org>2020-05-11 11:03:15 +0000
commit656d441607d322134ce035392923ad2d147fbc5d (patch)
treeadd86d10e4acf232427944460aabc9dd7548800b /tests/lib/libc
parentd7ac05e492adc28be8a526f30d850e375979095a (diff)
Do not fail when trying to kill a dying process
A dying process can disappear for a while. Rather than aborting, retry sending SIGKILL to it.
Diffstat (limited to 'tests/lib/libc')
-rw-r--r--tests/lib/libc/sys/t_ptrace_register_wait.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/tests/lib/libc/sys/t_ptrace_register_wait.h b/tests/lib/libc/sys/t_ptrace_register_wait.h
index 63361deb01a..e720c1bbd05 100644
--- a/tests/lib/libc/sys/t_ptrace_register_wait.h
+++ b/tests/lib/libc/sys/t_ptrace_register_wait.h
@@ -1,4 +1,4 @@
-/* $NetBSD: t_ptrace_register_wait.h,v 1.1 2020/05/04 20:55:48 kamil Exp $ */
+/* $NetBSD: t_ptrace_register_wait.h,v 1.2 2020/05/11 11:03:15 kamil Exp $ */
/*-
* Copyright (c) 2016, 2017, 2018, 2019, 2020 The NetBSD Foundation, Inc.
@@ -136,7 +136,12 @@ access_regs(const char *regset, const char *aux)
if (strstr(aux, "unaligned") != NULL) {
DPRINTF("Before resuming the child process where it left off "
"and without signal to be sent\n");
- SYSCALL_REQUIRE(ptrace(PT_KILL, child, NULL, 0) != -1);
+ for (;;) {
+ errno = 0;
+ if (ptrace(PT_KILL, child, NULL, 0) == 0)
+ break;
+ ATF_REQUIRE_EQ(errno, ESRCH);
+ }
DPRINTF("Before calling %s() for the child\n", TWAIT_FNAME);
TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0),