It seems that if there's no child process terminated, waitpid won't set status.
This will cause problem when status=0 initially, which is the case on the server
Also explains why everything is ok locally, where initail value of status is some random number
It seems that if there's no child process terminated, waitpid won't set status. This will cause problem when status=0 initially, which is the case on the server Also explains why everything is ok locally, where initail value of status is some random number