Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 20 Oct 2015 20:12:42 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r289658 - head/sys/kern
Message-ID:  <201510202012.t9KKCgOK056637@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kib
Date: Tue Oct 20 20:12:42 2015
New Revision: 289658
URL: https://svnweb.freebsd.org/changeset/base/289658

Log:
  No need to dereference struct proc to pids when comparing processes
  for equality.
  
  Reviewed by:	jhb, pho
  Tested by:	pho
  Sponsored by:	The FreeBSD Foundation
  MFC after:	2 weeks

Modified:
  head/sys/kern/sys_process.c

Modified: head/sys/kern/sys_process.c
==============================================================================
--- head/sys/kern/sys_process.c	Tue Oct 20 19:52:59 2015	(r289657)
+++ head/sys/kern/sys_process.c	Tue Oct 20 20:12:42 2015	(r289658)
@@ -749,7 +749,7 @@ kern_ptrace(struct thread *td, int req, 
 
 	case PT_ATTACH:
 		/* Self */
-		if (p->p_pid == td->td_proc->p_pid) {
+		if (p == td->td_proc) {
 			error = EINVAL;
 			goto fail;
 		}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201510202012.t9KKCgOK056637>