[PATCH 4/5] run-command: do not warn about child death by SIGINT
- From
Jeff King <peff@peff.net>
- Date
- Nov 11, 2012, 16:56 UTC
- Message-ID
- <20121111165654.GD19850@sigill.intra.peff.net>
- In-Reply-To
- <20121111163100.GB13188@sigill.intra.peff.net>
SIGINT is not generally an interesting signal to the user, since it is typically caused by them hitting "^C" or otherwise telling their terminal to send the signal.
Signed-off-by: Jeff King <peff@peff.net> --- I thought about making this an optional parameter for run-command, but it seems like everybody would want this (and most callsites will complain about a failed command separately, anyway, so it is not like errors would go unnoticed).
run-command.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/run-command.c b/run-command.c index 3aae270..0527c61 100644 --- a/run-command.c +++ b/run-command.c @@ -242,7 +242,8 @@ static int wait_or_whine(pid_t pid, const char *argv0) error("waitpid is confused (%s)", argv0); } else if (WIFSIGNALED(status)) { code = WTERMSIG(status); - error("%s died of signal %d", argv0, code); + if (code != SIGINT) + error("%s died of signal %d", argv0, code); /* * This return value is chosen so that code & 0xff * mimics the exit code that a POSIX shell would report for
-- 1.8.0.207.gdf2154c