[PATCH v2 36/43] run-command: track total number of commands run
- From
David Turner <dturner@twopensource.com>
- Date
- Sep 28, 2015, 22:02 UTC
- Message-ID
- <1443477738-32023-37-git-send-email-dturner@twopensource.com>
- In-Reply-To
- <1443477738-32023-1-git-send-email-dturner@twopensource.com>
Soon, the db refs backend will use this to restart read transactions after subcommands which might have modified the refs database.
Signed-off-by: David Turner <dturner@twopensource.com> --- run-command.c | 2 ++ run-command.h | 1 + 2 files changed, 3 insertions(+)
diff --git a/run-command.c b/run-command.c index ceee5d1..9ee6c85 100644 --- a/run-command.c +++ b/run-command.c @@ -19,6 +19,7 @@ struct child_to_clean { }; static struct child_to_clean *children_to_clean; static int installed_child_cleanup_handler; +int total_commands_run = 0; static void cleanup_children(int sig, int in_signal) { @@ -349,6 +350,7 @@ fail_pipe: cmd->err = fderr[0]; } + total_commands_run++; trace_argv_printf(cmd->argv, "trace: run_command:"); fflush(NULL); diff --git a/run-command.h b/run-command.h index aa2a528..ef7ae7a 100644 --- a/run-command.h +++ b/run-command.h @@ -158,4 +158,5 @@ int run_processes_parallel(int n, void *data, start_failure_fn, return_value_fn); +extern int total_commands_run; #endif
-- 2.4.2.644.g97b850b-twtrsrc