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


##########
fs/procfs/fs_procfs.c:
##########
@@ -934,11 +935,14 @@ static int procfs_readdir(FAR struct inode *mountpt,
 
 #ifndef CONFIG_FS_PROCFS_EXCLUDE_PROCESS
       /* Skip the tasks of the snapshot of opendir() that have ended since:
-       * the walk goes on with the next one, as on Linux.
+       * the walk goes on with the next one, as on Linux.  A task has ended
+       * when kill() does not find it (nxsig_kill_target()): its TCB can
+       * stay in the table after its parent has waited for it.
        */
 
       while (priv->index < priv->nentries &&
-             nxsched_get_tcb(level0->pid[priv->index]) == NULL)
+             (nxsched_get_tcb(level0->pid[priv->index]) == NULL ||

Review Comment:
   No: nxsig_kill_target() returns 0 for a zombie whose TCB is already gone 
(the child record in its parent), so nxsched_get_tcb() == NULL still has to 
skip that pid.
   



-- 
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