Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 165676
b: refs/heads/master
c: 5c01ba4
h: refs/heads/master
v: v3
  • Loading branch information
Oleg Nesterov authored and Linus Torvalds committed Sep 24, 2009
1 parent 6d581f6 commit 229b160
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b4fe51823d797d6959b2eee7868023e61606daa9
refs/heads/master: 5c01ba49e6647d86bc7576105f82027200d1f303
15 changes: 9 additions & 6 deletions trunk/kernel/exit.c
Original file line number Diff line number Diff line change
Expand Up @@ -1111,13 +1111,16 @@ static struct pid *task_pid_type(struct task_struct *task, enum pid_type type)
return pid;
}

static int eligible_child(struct wait_opts *wo, struct task_struct *p)
static inline int eligible_pid(struct wait_opts *wo, struct task_struct *p)
{
if (wo->wo_type < PIDTYPE_MAX) {
if (task_pid_type(p, wo->wo_type) != wo->wo_pid)
return 0;
}
return wo->wo_type == PIDTYPE_MAX ||
task_pid_type(p, wo->wo_type) == wo->wo_pid;
}

static int eligible_child(struct wait_opts *wo, struct task_struct *p)
{
if (!eligible_pid(wo, p))
return 0;
/* Wait for all children (clone and not) if __WALL is set;
* otherwise, wait for clone children *only* if __WCLONE is
* set; otherwise, wait for non-clone children *only*. (Note:
Expand Down Expand Up @@ -1578,7 +1581,7 @@ static int child_wait_callback(wait_queue_t *wait, unsigned mode,
child_wait);
struct task_struct *p = key;

if (!eligible_child(wo, p))
if (!eligible_pid(wo, p))
return 0;

if ((wo->wo_flags & __WNOTHREAD) && wait->private != p->parent)
Expand Down

0 comments on commit 229b160

Please sign in to comment.