Module Name:    src
Committed By:   kamil
Date:           Wed May 30 23:54:03 UTC 2018

Modified Files:
        src/sys/kern: sys_ptrace_common.c

Log Message:
Simplify comparison of two processes

No need to check p_pid to compare whether two processes are the same.

No functional change intended.

Sponsored by <The NetBSD Foundation>


To generate a diff of this commit:
cvs rdiff -u -r1.43 -r1.44 src/sys/kern/sys_ptrace_common.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/kern/sys_ptrace_common.c
diff -u src/sys/kern/sys_ptrace_common.c:1.43 src/sys/kern/sys_ptrace_common.c:1.44
--- src/sys/kern/sys_ptrace_common.c:1.43	Tue May 29 23:34:18 2018
+++ src/sys/kern/sys_ptrace_common.c	Wed May 30 23:54:03 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: sys_ptrace_common.c,v 1.43 2018/05/29 23:34:18 kamil Exp $	*/
+/*	$NetBSD: sys_ptrace_common.c,v 1.44 2018/05/30 23:54:03 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.43 2018/05/29 23:34:18 kamil Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sys_ptrace_common.c,v 1.44 2018/05/30 23:54:03 kamil Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ptrace.h"
@@ -403,7 +403,7 @@ ptrace_allowed(struct lwp *l, int req, s
 		 * You can't attach to a process if:
 		 *	(1) it's the process that's doing the attaching,
 		 */
-		if (t->p_pid == p->p_pid)
+		if (t == p)
 			return EINVAL;
 
 		/*

Reply via email to