With WNOHANG we skip sending the email when waitpid() returns 0, which happens if the process is still running. Instead, using 0 parameter will wait for the process to actually stop running.
This issue has been present, because of adapting NetBSD cron, instead of OpenBSD cron
After some discussion, I think it is better to wait for the grandchild process to end, instead of skipping sending an email, but I'm open to discussion on how to make this better.
With
WNOHANG
we skip sending the email when waitpid() returns 0, which happens if the process is still running. Instead, using0
parameter will wait for the process to actually stop running.This issue has been present, because of adapting NetBSD cron, instead of OpenBSD cron After some discussion, I think it is better to wait for the grandchild process to end, instead of skipping sending an email, but I'm open to discussion on how to make this better.