Record the errno if exec fails
This commit is contained in:
@ -161,9 +161,9 @@ sub buildFinished {
|
||||
$runlog->started();
|
||||
|
||||
system("$command") == 0
|
||||
or warn "notification command '$command' failed with exit status $?\n";
|
||||
or warn "notification command '$command' failed with exit status $? ($!)\n";
|
||||
|
||||
$runlog->completed_with_child_error($?);
|
||||
$runlog->completed_with_child_error($?, $!);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -197,7 +197,10 @@ sub completed_with_child_error {
|
||||
if ($child_error == -1) {
|
||||
# -1 indicates `exec` failed, and this is the only
|
||||
# case where the reported errno is valid.
|
||||
$errno = $reported_errno;
|
||||
#
|
||||
# The `+ 0` is because $! is a dual var and likes to be a string
|
||||
# if it can. +0 forces it to not be. Sigh.
|
||||
$errno = $reported_errno + 0;
|
||||
}
|
||||
|
||||
if (WIFEXITED($child_error)) {
|
||||
|
Reference in New Issue
Block a user