Kurt Roeckx wrote: > > si_pid will only be nonzero if waitid succeeded. > > Like I said it probably will, but I'm not sure there is any > guarantee in that case. In any case I think it's a bad idea > to not look at the return value.
The man page explicitly recommends zeroing si_pid and checking for a nonzero value, the way parallel does. > > If waitid fails, the code returns -1, and this is ORed to the > > returncode. Since the returncode is an int, it then becomes 255, > > so that's what parallel will exit if it fails to wait for a child. > > Which is my main problem. It probably calls waitid() when there > nothing to wait for anymore or something like that. In any case > that "return -1" is my problem. If parallel called waitid() with no child to wait for, then it would have a bug in its control logic (ie, a fencepost bug) that would probably manifest in other ways than the exit code; such as running too many or too few parallel processes. At this point all I have is speculation that parallel is broken, but nothing to go on to fix it. I'll need a command line, a test case, a strace, or *something*. -- see shy jo
signature.asc
Description: Digital signature