aboutsummaryrefslogtreecommitdiff
path: root/nuttx/sched/task_childstatus.c
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2013-01-24 23:18:32 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2013-01-24 23:18:32 +0000
commita2ec48846f786e72a976038c9467b25a61ad5a9f (patch)
treec4f4fcda6c667b7928c3b2aaa89a81027e298b47 /nuttx/sched/task_childstatus.c
parent25e9b8d0846b68a18014c63146234193bfe539e8 (diff)
downloadpx4-firmware-a2ec48846f786e72a976038c9467b25a61ad5a9f.tar.gz
px4-firmware-a2ec48846f786e72a976038c9467b25a61ad5a9f.tar.bz2
px4-firmware-a2ec48846f786e72a976038c9467b25a61ad5a9f.zip
Fix some missing logic and inconsistencies in child status logic; Fix a bug introduced into sigaction()
git-svn-id: http://svn.code.sf.net/p/nuttx/code/trunk@5560 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/sched/task_childstatus.c')
-rw-r--r--nuttx/sched/task_childstatus.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/nuttx/sched/task_childstatus.c b/nuttx/sched/task_childstatus.c
index 0f6d36c29..09aa48135 100644
--- a/nuttx/sched/task_childstatus.c
+++ b/nuttx/sched/task_childstatus.c
@@ -298,6 +298,42 @@ FAR struct child_status_s *task_findchild(FAR _TCB *tcb, pid_t pid)
}
/*****************************************************************************
+ * Name: task_exitchild
+ *
+ * Description:
+ * Search for any child that has exitted.
+ *
+ * Parameters:
+ * tcb - The TCB of the parent task to containing the child status.
+ *
+ * Return Value:
+ * On success, a non-NULL pointer to a child status structure for the
+ * exited child. NULL is returned if not child has exited.
+ *
+ * Assumptions:
+ * Called during SIGCHLD processing in a safe context. No special precautions
+ * are required here.
+ *
+ *****************************************************************************/
+
+FAR struct child_status_s *task_exitchild(FAR _TCB *tcb)
+{
+ FAR struct child_status_s *child;
+
+ /* Find the status structure with the matching PID */
+
+ for (child = tcb->children; child; child = child->flink)
+ {
+ if ((child->ch_flags & CHILD_FLAG_EXITED) != 0)
+ {
+ return child;
+ }
+ }
+
+ return NULL;
+}
+
+/*****************************************************************************
* Name: task_removechild
*
* Description: