Sorry, come to think about it, simply return if rv is -1, because that means there are no un-waited children left.
You should definately first fix the pcint Status issue, because if you give an invalid argument ot waitpid, it returns -1 and sets errno to EINVAL. while true rv := waitpid(-1, Status, WNOHANG); if rv=-1 if fpGetErrno <> ECHILD the report "ERROR: unexpected error: " fpGetErrno return; else if rv<>0 report "DEBUG: pid " rv " exited with status " Status continue; end; {* while true *} Best regards, T. _______________________________________________ Dng mailing list Dng@lists.dyne.org https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng