From owner-svn-src-stable@FreeBSD.ORG Wed Feb 6 13:49:57 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 0B07BB29; Wed, 6 Feb 2013 13:49:57 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id F1BC6ACC; Wed, 6 Feb 2013 13:49:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r16DnuYi032654; Wed, 6 Feb 2013 13:49:56 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r16DnuQ3032653; Wed, 6 Feb 2013 13:49:56 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201302061349.r16DnuQ3032653@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 6 Feb 2013 13:49:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246404 - stable/9/sys/kern X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Feb 2013 13:49:57 -0000 Author: kib Date: Wed Feb 6 13:49:56 2013 New Revision: 246404 URL: http://svnweb.freebsd.org/changeset/base/246404 Log: MFC r246118: The case of pid == WAIT_MYPGRP for the kern_wait() is already handled in kern_wait6(), which is called by kern_wait(). Remove the redundand check, introduced in r243136, and add a comment noting this, to make the code less confusing. Modified: stable/9/sys/kern/kern_exit.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/kern_exit.c ============================================================================== --- stable/9/sys/kern/kern_exit.c Wed Feb 6 13:17:41 2013 (r246403) +++ stable/9/sys/kern/kern_exit.c Wed Feb 6 13:49:56 2013 (r246404) @@ -1019,20 +1019,18 @@ kern_wait(struct thread *td, pid_t pid, struct rusage *rusage) { struct __wrusage wru, *wrup; - struct proc *q; idtype_t idtype; id_t id; int ret; + /* + * Translate the special pid values into the (idtype, pid) + * pair for kern_wait6. The WAIT_MYPGRP case is handled by + * kern_wait6() on its own. + */ if (pid == WAIT_ANY) { idtype = P_ALL; id = 0; - } else if (pid == WAIT_MYPGRP) { - idtype = P_PGID; - q = td->td_proc; - PROC_LOCK(q); - id = (id_t)q->p_pgid; - PROC_UNLOCK(q); } else if (pid < 0) { idtype = P_PGID; id = (id_t)-pid; @@ -1040,10 +1038,12 @@ kern_wait(struct thread *td, pid_t pid, idtype = P_PID; id = (id_t)pid; } + if (rusage != NULL) wrup = &wru; else wrup = NULL; + /* * For backward compatibility we implicitly add flags WEXITED * and WTRAPPED here.