From 1be66e47fb2675f35f301e5e0f7e9e66e70d2437 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sat, 16 Jul 2016 23:34:32 +0100 Subject: Subprocess error handling: Do not call faildcmd when open fails failecmd wants to look at $? too and anyway the full command is not of much interest in these cases. --- dgit | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'dgit') diff --git a/dgit b/dgit index ddcde9a..f60180c 100755 --- a/dgit +++ b/dgit @@ -533,7 +533,7 @@ sub git_slurp_config () { my @cmd = (@git, qw(config -z --get-regexp .*)); debugcmd "|",@cmd; - open GITS, "-|", @cmd or failedcmd @cmd; + open GITS, "-|", @cmd or die $!; while () { chomp or die; printdebug "=> ", (messagequote $_), "\n"; @@ -1243,7 +1243,7 @@ sub git_write_tree () { sub remove_stray_gits () { my @gitscmd = qw(find -name .git -prune -print0); debugcmd "|",@gitscmd; - open GITS, "-|", @gitscmd or failedcmd @gitscmd; + open GITS, "-|", @gitscmd or die $!; { local $/="\0"; while () { -- cgit v1.2.3