|
|
@ -782,15 +782,11 @@ sub command_exit_is |
|
|
|
my $h = IPC::Run::start $cmd; |
|
|
|
my $h = IPC::Run::start $cmd; |
|
|
|
$h->finish(); |
|
|
|
$h->finish(); |
|
|
|
|
|
|
|
|
|
|
|
# On Windows, the exit status of the process is returned directly as the |
|
|
|
# Normally, if the child called exit(N), IPC::Run::result() returns N. On |
|
|
|
# process's exit code, while on Unix, it's returned in the high bits |
|
|
|
# Windows, with IPC::Run v20220807.0 and earlier, full_results() is the |
|
|
|
# of the exit code (see WEXITSTATUS macro in the standard <sys/wait.h> |
|
|
|
# method that returns N (https://github.com/toddr/IPC-Run/issues/161). |
|
|
|
# header file). IPC::Run's result function always returns exit code >> 8, |
|
|
|
|
|
|
|
# assuming the Unix convention, which will always return 0 on Windows as |
|
|
|
|
|
|
|
# long as the process was not terminated by an exception. To work around |
|
|
|
|
|
|
|
# that, use $h->full_results on Windows instead. |
|
|
|
|
|
|
|
my $result = |
|
|
|
my $result = |
|
|
|
($Config{osname} eq "MSWin32") |
|
|
|
($Config{osname} eq "MSWin32" && $IPC::Run::VERSION <= 20220807.0) |
|
|
|
? ($h->full_results)[0] |
|
|
|
? ($h->full_results)[0] |
|
|
|
: $h->result(0); |
|
|
|
: $h->result(0); |
|
|
|
is($result, $expected, $test_name); |
|
|
|
is($result, $expected, $test_name); |
|
|
|