casaroli commented on code in PR #21352:
URL: https://github.com/apache/nuttx/pull/21352#discussion_r4445605865


##########
sched/sched/sched_waitid.c:
##########
@@ -130,20 +133,27 @@ int waittcb(FAR struct tcb_s *rtcb, idtype_t idtype, int 
options,
               exited_child(rtcb, child, info, options);
               break;
             }
+
+          /* Without an exit status to wait for (XSI), wait until all
+           * children exit
+           */
+
+          if ((!retains || rtcb->group->tg_children == NULL) &&
+              !group_has_child(rtcb->group, INVALID_PROCESS_ID))
+            {
+              errcode = ECHILD;
+              break;
+            }
         }
 
       /* We are waiting for a specific PID.  Does this task retain child
        * status?
        */
 
-      else if (retains)
+      else if (retains &&
+               (child = group_find_child(rtcb->group, (pid_t)id)) != NULL)

Review Comment:
   Done.



##########
sched/sched/sched_waitid.c:
##########
@@ -155,22 +165,14 @@ int waittcb(FAR struct tcb_s *rtcb, idtype_t idtype, int 
options,
               break;
             }
         }
-      else
+      else if (!group_has_child(rtcb->group, (pid_t)id))

Review Comment:
   Done.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to