From owner-svn-src-stable-12@freebsd.org Tue Sep 10 20:20:46 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 41105E357A; Tue, 10 Sep 2019 20:20:46 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46Sby611nnz3ylh; Tue, 10 Sep 2019 20:20:46 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0683D2B6B3; Tue, 10 Sep 2019 20:20:46 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8AKKjf4052341; Tue, 10 Sep 2019 20:20:45 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8AKKjb0052340; Tue, 10 Sep 2019 20:20:45 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <201909102020.x8AKKjb0052340@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Tue, 10 Sep 2019 20:20:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r352184 - stable/12/sys/kern X-SVN-Group: stable-12 X-SVN-Commit-Author: oshogbo X-SVN-Commit-Paths: stable/12/sys/kern X-SVN-Commit-Revision: 352184 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Sep 2019 20:20:46 -0000 Author: oshogbo Date: Tue Sep 10 20:20:45 2019 New Revision: 352184 URL: https://svnweb.freebsd.org/changeset/base/352184 Log: MFCr350616: process: style We don't need to check if the parent is already set. This is done already in the proc_reparent. No functional behaviour changes intended. MFC after: 1 month Modified: stable/12/sys/kern/sys_process.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/kern/sys_process.c ============================================================================== --- stable/12/sys/kern/sys_process.c Tue Sep 10 20:19:29 2019 (r352183) +++ stable/12/sys/kern/sys_process.c Tue Sep 10 20:20:45 2019 (r352184) @@ -929,9 +929,7 @@ kern_ptrace(struct thread *td, int req, pid_t pid, voi * on a "detach". */ proc_set_traced(p, true); - if (p->p_pptr != td->td_proc) { - proc_reparent(p, td->td_proc, false); - } + proc_reparent(p, td->td_proc, false); CTR2(KTR_PTRACE, "PT_ATTACH: pid %d, oppid %d", p->p_pid, p->p_oppid); @@ -1048,7 +1046,7 @@ kern_ptrace(struct thread *td, int req, pid_t pid, voi bcopy(td2->td_sa.args, addr, td2->td_sa.narg * sizeof(register_t)); break; - + case PT_STEP: case PT_CONTINUE: case PT_TO_SCE: @@ -1158,8 +1156,8 @@ kern_ptrace(struct thread *td, int req, pid_t pid, voi sendsig: MPASS(proctree_locked == 0); - - /* + + /* * Clear the pending event for the thread that just * reported its event (p_xthread). This may not be * the thread passed to PT_CONTINUE, PT_STEP, etc. if