[haiku-commits] r41672 - haiku/branches/developer/bonefish/signals/src/system/kernel

  • From: ingo_weinhold@xxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Mon, 23 May 2011 13:23:43 +0200 (CEST)

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);
+                               }
                        }
                }
 


Other related posts:

  • » [haiku-commits] r41672 - haiku/branches/developer/bonefish/signals/src/system/kernel - ingo_weinhold