Author: bonefish Date: 2011-05-23 13:23:43 +0200 (Mon, 23 May 2011) New Revision: 41672 Changeset: https://dev.haiku-os.org/changeset/41672 Modified: haiku/branches/developer/bonefish/signals/src/system/kernel/team.cpp Log: wait_for_child(): Added support for WNOWAIT. Modified: haiku/branches/developer/bonefish/signals/src/system/kernel/team.cpp =================================================================== --- haiku/branches/developer/bonefish/signals/src/system/kernel/team.cpp 2011-05-23 11:22:55 UTC (rev 41671) +++ haiku/branches/developer/bonefish/signals/src/system/kernel/team.cpp 2011-05-23 11:23:43 UTC (rev 41672) @@ -2205,15 +2205,17 @@ } else { // got something foundEntry = *entry; - if (entry->state == JOB_CONTROL_STATE_DEAD) { - // The child is dead. Reap its death entry. - freeDeathEntry = entry; - team->dead_children.entries.Remove(entry); - team->dead_children.count--; - } else { - // The child is well. Reset its job control state. - team_set_job_control_state(entry->team, - JOB_CONTROL_STATE_NONE, NULL, false); + if ((flags & WNOWAIT) == 0 || ignoreFoundEntries) { + if (entry->state == JOB_CONTROL_STATE_DEAD) { + // The child is dead. Reap its death entry. + freeDeathEntry = entry; + team->dead_children.entries.Remove(entry); + team->dead_children.count--; + } else { + // The child is well. Reset its job control state. + team_set_job_control_state(entry->team, + JOB_CONTROL_STATE_NONE, NULL, false); + } } }