diff options
| author | Junio C Hamano <gitster@pobox.com> | 2021-02-22 16:12:43 -0800 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2021-02-22 16:12:43 -0800 |
| commit | dcb11fc6225edbe2bd7af63eb550b739e7f4a074 (patch) | |
| tree | de4f1af9240b7746606d89c0ded10b5a2941fd05 /run-command.c | |
| parent | dc24948be923343fb4ac22beff39850d661ff3c8 (diff) | |
| parent | be8fc53e364211856cca7affa4472855f96f8fa9 (diff) | |
| download | git-dcb11fc6225edbe2bd7af63eb550b739e7f4a074.tar.xz | |
Merge branch 'ab/pager-exit-log'
When a pager spawned by us exited, the trace log did not record its
exit status correctly, which has been corrected.
* ab/pager-exit-log:
pager: properly log pager exit code when signalled
run-command: add braces for "if" block in wait_or_whine()
pager: test for exit code with and without SIGPIPE
pager: refactor wait_for_pager() function
Diffstat (limited to 'run-command.c')
| -rw-r--r-- | run-command.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/run-command.c b/run-command.c index ea4d0fb4b1..509841bf27 100644 --- a/run-command.c +++ b/run-command.c @@ -551,8 +551,11 @@ static int wait_or_whine(pid_t pid, const char *argv0, int in_signal) while ((waiting = waitpid(pid, &status, 0)) < 0 && errno == EINTR) ; /* nothing */ - if (in_signal) - return 0; + if (in_signal) { + if (WIFEXITED(status)) + code = WEXITSTATUS(status); + return code; + } if (waiting < 0) { failed_errno = errno; |
