1
0
mirror of https://github.com/mpv-player/mpv synced 2025-01-09 08:29:36 +00:00

TOOLS/zsh.pl: only check the actual exit code when calling mpv

Ignore the other bits of $?. Apparently they can be set even if the
command succeeded.
This commit is contained in:
Philip Sequeira 2015-09-19 19:26:22 -04:00 committed by wm4
parent 126367bb09
commit bad743aed5

View File

@ -232,8 +232,8 @@ sub call_mpv {
my $output = `"$mpv" --no-config $cmd`; my $output = `"$mpv" --no-config $cmd`;
if ($? == -1) { if ($? == -1) {
die "Could not run mpv: $!"; die "Could not run mpv: $!";
} elsif ($? != 0) { } elsif ((my $exit_code = $? >> 8) != 0) {
die "mpv returned " . ($? >> 8) . " with output:\n$output"; die "mpv returned $exit_code with output:\n$output";
} }
return split /\n/, $output; return split /\n/, $output;
} }