mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-11-01 09:11:36 +08:00
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user