8000 Print correct exit code after unsuccessful commands in cmd() by gregbo · Pull Request #35 · toreanderson/clatd · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Print correct exit code after unsuccessful commands in cmd() #35

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 4, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions clatd
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ sub err {
#
# Runs a command. First argument is what subroutine to call to a message if
# the command doesn't exit successfully, second is the command itself, and
# any more is the command line arguments.
# any more are the command line arguments.
#
sub cmd {
my $msgsub = shift;
Expand All @@ -98,7 +98,7 @@ sub cmd {
} elsif($? & 127) {
&{$msgsub}("cmd(@cmd) died with signal ", ($? & 127));
} else {
&{$msgsub}("cmd(@cmd) returned ", ($? >> 127));
&{$msgsub}("cmd(@cmd) returned ", ($? >> 8));
}
}
return $?;
Expand Down
0