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
1 changed files with 2 additions and 2 deletions

View File

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