X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=run-command.c;h=a2796c4caecc0fae6ea1a95b2c965b92d98f8a31;hb=77f7f822889411bfede0507dd60aebf11edb2849;hp=5c91f37fb891c09bffa20343e037979ac340eaf1;hpb=3bc4181fde899e02aff89f7c0a47f18d37311cb3;p=git.git diff --git a/run-command.c b/run-command.c index 5c91f37fb..a2796c4ca 100644 --- a/run-command.c +++ b/run-command.c @@ -125,9 +125,6 @@ static int wait_or_whine(pid_t pid, const char *argv0, int silent_exec_failure) if (code == 127) { code = -1; failed_errno = ENOENT; - if (!silent_exec_failure) - error("cannot run %s: %s", argv0, - strerror(ENOENT)); } } else { error("waitpid is confused (%s)", argv0); @@ -282,14 +279,14 @@ fail_pipe: } else { execvp(cmd->argv[0], (char *const*) cmd->argv); } - /* - * Do not check for cmd->silent_exec_failure; the parent - * process will check it when it sees this exit code. - */ - if (errno == ENOENT) + if (errno == ENOENT) { + if (!cmd->silent_exec_failure) + error("cannot run %s: %s", cmd->argv[0], + strerror(ENOENT)); exit(127); - else + } else { die_errno("cannot exec '%s'", cmd->argv[0]); + } } if (cmd->pid < 0) error("cannot fork() for %s: %s", cmd->argv[0],