Source-Changes-HG archive

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

[src/trunk]: src/sys/kern Remove 2 static asserts from the kernel ptrace code



details:   https://anonhg.NetBSD.org/src/rev/4594288a1c5e
branches:  trunk
changeset: 459929:4594288a1c5e
user:      kamil <kamil%NetBSD.org@localhost>
date:      Tue Oct 01 21:49:50 2019 +0000

description:
Remove 2 static asserts from the kernel ptrace code

sizeof(pid) and sizeof(lwp) will unlikely ever change and the check can
confuse.

The assert has been moved to ATF t_ptrace_wait.c r.1.132.

Requested by <christos>

diffstat:

 sys/kern/sys_ptrace_common.c |  9 ++-------
 1 files changed, 2 insertions(+), 7 deletions(-)

diffs (31 lines):

diff -r a0521029701e -r 4594288a1c5e sys/kern/sys_ptrace_common.c
--- a/sys/kern/sys_ptrace_common.c      Tue Oct 01 21:36:54 2019 +0000
+++ b/sys/kern/sys_ptrace_common.c      Tue Oct 01 21:49:50 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sys_ptrace_common.c,v 1.60 2019/10/01 18:44:22 kamil Exp $     */
+/*     $NetBSD: sys_ptrace_common.c,v 1.61 2019/10/01 21:49:50 kamil Exp $     */
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -118,7 +118,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sys_ptrace_common.c,v 1.60 2019/10/01 18:44:22 kamil Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sys_ptrace_common.c,v 1.61 2019/10/01 21:49:50 kamil Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ptrace.h"
@@ -704,12 +704,7 @@
                si = &t->p_sigctx.ps_info;
                ps.pe_report_event = si->_reason._ptrace_state._pe_report_event;
 
-               CTASSERT(sizeof(ps.pe_other_pid) ==
-                   sizeof(si->_reason._ptrace_state._option._pe_other_pid));
-               CTASSERT(sizeof(ps.pe_lwp) ==
-                   sizeof(si->_reason._ptrace_state._option._pe_other_pid));
                CTASSERT(sizeof(ps.pe_other_pid) == sizeof(ps.pe_lwp));
-
                ps.pe_other_pid =
                        si->_reason._ptrace_state._option._pe_other_pid;
        }



Home | Main Index | Thread Index | Old Index