On 11 Jul 2005, at 11:43, Robert Spier wrote:
Anyone have any thoughts on how to solve this? Can you tell waitpid()
to only operate on child processes and not grandchild processes?
No, but you can tell it to only wait for a specific pid. But that
won't help in this case.
Ah actually I think the bug was slightly different to what I thought I
was seeing.
When qmail-queue doesn't exist, the exec fails, and the parent can end
up sat trying to wait to write onto the message pipe. A simple check
for if(eof(PIPE)) fixes it, though there's still a race there because
of the blocking nature of the write.
This could also be specific to Mac pipes - I wonder if the write will
fail on Linux if the process has exited.
I'll check a fix into the 0.31 branch and trunk in any case.
Matt.