Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/tests/lib/libc/sys Simplify previous



details:   https://anonhg.NetBSD.org/src/rev/375c8e3f7755
branches:  trunk
changeset: 932559:375c8e3f7755
user:      kamil <kamil%NetBSD.org@localhost>
date:      Mon May 11 12:17:57 2020 +0000

description:
Simplify previous

Emit SIGKILL without a loop and without checking for exact process status
once it is collected.

diffstat:

 tests/lib/libc/sys/t_ptrace_register_wait.h |  12 +++---------
 1 files changed, 3 insertions(+), 9 deletions(-)

diffs (31 lines):

diff -r c48ee356bc1c -r 375c8e3f7755 tests/lib/libc/sys/t_ptrace_register_wait.h
--- a/tests/lib/libc/sys/t_ptrace_register_wait.h       Mon May 11 11:03:15 2020 +0000
+++ b/tests/lib/libc/sys/t_ptrace_register_wait.h       Mon May 11 12:17:57 2020 +0000
@@ -1,4 +1,4 @@
-/*      $NetBSD: t_ptrace_register_wait.h,v 1.2 2020/05/11 11:03:15 kamil Exp $   */
+/*      $NetBSD: t_ptrace_register_wait.h,v 1.3 2020/05/11 12:17:57 kamil Exp $   */
 
 /*-
  * Copyright (c) 2016, 2017, 2018, 2019, 2020 The NetBSD Foundation, Inc.
@@ -136,19 +136,13 @@
        if (strstr(aux, "unaligned") != NULL) {
                DPRINTF("Before resuming the child process where it left off "
                    "and without signal to be sent\n");
-               for (;;) {
-                       errno = 0;
-                       if (ptrace(PT_KILL, child, NULL, 0) == 0)
-                               break;
-                       ATF_REQUIRE_EQ(errno, ESRCH);
-               }
+
+               ptrace(PT_KILL, child, NULL, 0);
 
                DPRINTF("Before calling %s() for the child\n", TWAIT_FNAME);
                TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(child, &status, 0),
                    child);
 
-               validate_status_signaled(status, SIGKILL, 0);
-
                DPRINTF("Before calling %s() for the child\n", TWAIT_FNAME);
                TWAIT_REQUIRE_FAILURE(ECHILD,
                    wpid = TWAIT_GENERIC(child, &status, 0));



Home | Main Index | Thread Index | Old Index