Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitd419d39

Browse files
committed
Account for IPC::Run::result() Windows behavior change.
This restores compatibility with the not-yet-released successor ofversion 20220807.0. Back-patch to 9.4, which introduced this code.Reviewed by Andrew Dunstan.Discussion:https://postgr.es/m/20221117061805.GA4020280@rfd.leadboat.com
1 parent20c2233 commitd419d39

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

‎src/test/perl/TestLib.pm

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -710,15 +710,11 @@ sub command_exit_is
710710
my$h = IPC::Run::start$cmd;
711711
$h->finish();
712712

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

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp