diff options
Diffstat (limited to 'run-command.c')
-rw-r--r-- | run-command.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/run-command.c b/run-command.c index 8c6f09b729..be6bc128cd 100644 --- a/run-command.c +++ b/run-command.c @@ -7,6 +7,7 @@ #include "strbuf.h" #include "string-list.h" #include "quote.h" +#include "config.h" void child_process_init(struct child_process *child) { @@ -550,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; @@ -1634,8 +1638,8 @@ static void pp_init(struct parallel_processes *pp, pp->nr_processes = 0; pp->output_owner = 0; pp->shutdown = 0; - pp->children = xcalloc(n, sizeof(*pp->children)); - pp->pfd = xcalloc(n, sizeof(*pp->pfd)); + CALLOC_ARRAY(pp->children, n); + CALLOC_ARRAY(pp->pfd, n); strbuf_init(&pp->buffered_output, 0); for (i = 0; i < n; i++) { @@ -1875,8 +1879,13 @@ int run_processes_parallel_tr2(int n, get_next_task_fn get_next_task, int run_auto_maintenance(int quiet) { + int enabled; struct child_process maint = CHILD_PROCESS_INIT; + if (!git_config_get_bool("maintenance.auto", &enabled) && + !enabled) + return 0; + maint.git_cmd = 1; strvec_pushl(&maint.args, "maintenance", "run", "--auto", NULL); strvec_push(&maint.args, quiet ? "--quiet" : "--no-quiet"); |