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
This commit is contained in:
patacongo
2013-01-24 23:18:32 +00:00
parent 25e9b8d084
commit a2ec48846f
11 changed files with 324 additions and 108 deletions
+21 -3
View File
@@ -138,14 +138,32 @@ int task_reparent(pid_t ppid, pid_t chpid)
child = task_removechild(otcb, chpid);
if (child)
{
/* Add the child status entry to the new parent TCB */
/* Has the new parent supressed child exit status? */
if ((ptcb->flags && TCB_FLAG_NOCLDWAIT) == 0)
{
/* No.. Add the child status entry to the new parent TCB */
task_addchild(ptcb, child);
}
else
{
/* Yes.. Discard the child status entry */
task_freechild(child);
}
/* Either case is a success */
task_addchild(ptcb, child);
ret = OK;
}
else
{
ret = -ENOENT;
/* This would not be an error if the original parent has
* suppressed child exit status.
*/
ret = ((otcb->flags && TCB_FLAG_NOCLDWAIT) == 0) ? -ENOENT : OK;
}
#else
DEBUGASSERT(otcb->nchildren > 0);