Record the errno if exec fails

This commit is contained in:
Graham Christensen
2021-11-18 13:46:56 -05:00
parent 4ce8239cea
commit 5bb3e2be78
3 changed files with 56 additions and 3 deletions

View File

@ -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)) {