stat_exists link_ltarget
hashfile
fail ensuredir executable_on_path
- waitstatusmsg failedcmd
+ waitstatusmsg failedcmd_report_cmd failedcmd
cmdoutput cmdoutput_errok
git_rev_parse git_get_ref git_for_each_ref
git_for_each_tag_referring is_fast_fwd
}
}
+sub failedcmd_report_cmd {
+ my $intro = shift @_;
+ $intro //= "failed command";
+ { local ($!); printcmd \*STDERR, _us().": $intro:", @_ or die $!; };
+}
+
sub failedcmd {
# Expects $!,$? as set by close - see below.
# To use with system(), set $?=-1 first.
# success trashed $?==0 system
# program failed trashed $? >0 system
# syscall failure $! >0 unchanged system
- { local ($!); printcmd \*STDERR, _us().": failed command:", @_ or die $!; };
+ failedcmd_report_cmd undef, @_;
if ($? < 0) {
fail "failed to fork/exec: $!";
} elsif ($?) {