Open mgeisler opened 7 years ago
I am not too deeply into the topic, but I have the following understanding:
waitpid
waits for the end of the process and returns the PID of this process (or -1
, if the process does not exist anymore)$?
contains the "exitstatus" (16 bit, 8 bit exitcode and 8 bit incoming signals) of previously started processIn our code we use the following:
my $child_exit_status = ($? >> 8);
I have the feeling, that in general, this is the proper handling.
But I do not understand, why $?
equals -1
at this moment. The documentation for $?
does not mention negative values:
Does someone have an idea, how -1
could end up in $?
?
I have the vague feeling, it is specific to the environment, we created.
Related to #749, I noticed that an error is logged by
RRDs_graph
even if therrdtool
command works fine when run by hand. The error I see is"Luckily",
RRDs_graph
continues execution in this case and still sends the image to the client.I believe this might be because the return value of
waitpid
is interpreted in the wrong way. According to http://perldoc.perl.org/functions/waitpid.html the return value is-1
if the child process is not found.72057594037927935
is0xffffffffffffff
which looks like a-1
to me. I guessrrdtool
simply returned too fast on my machine.