summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_exit.c
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2013-01-30 13:14:15 +0000
committerkib <kib@FreeBSD.org>2013-01-30 13:14:15 +0000
commite81abcec51f86929c209e6be2e354198be170d50 (patch)
tree78ddd6bd30d88454c0caa7d8a6bed356b88e904b /sys/kern/kern_exit.c
parent3913be8cf6bae0deea4548df2c3655b08fc13966 (diff)
downloadFreeBSD-src-e81abcec51f86929c209e6be2e354198be170d50.zip
FreeBSD-src-e81abcec51f86929c209e6be2e354198be170d50.tar.gz
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. The blank lines are added to properly delineate the scope of the preceeding comments. Noted by: "Jukka A. Ukkonen" <jau@iki.fi> MFC after: 1 week
Diffstat (limited to 'sys/kern/kern_exit.c')
-rw-r--r--sys/kern/kern_exit.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/sys/kern/kern_exit.c b/sys/kern/kern_exit.c
index 50b47fb..3a9a3a4 100644
--- a/sys/kern/kern_exit.c
+++ b/sys/kern/kern_exit.c
@@ -1024,20 +1024,18 @@ kern_wait(struct thread *td, pid_t pid, int *status, int options,
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;
@@ -1045,10 +1043,12 @@ kern_wait(struct thread *td, pid_t pid, int *status, int options,
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.
OpenPOWER on IntegriCloud