chiark / gitweb /
Subprocess error handling: Do not call faildcmd when open fails
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 16 Jul 2016 22:34:32 +0000 (23:34 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 17 Jul 2016 12:46:14 +0000 (13:46 +0100)
failecmd wants to look at $? too and anyway the full command is not of
much interest in these cases.

dgit

diff --git a/dgit b/dgit
index ddcde9acc16148a4a6c1e97d290ef677110ab1e1..f60180c2b5e7a2ada68c4d688899851e519b6f94 100755 (executable)
--- 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 (<GITS>) {
        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 (<GITS>) {