Thread (82 messages) flat view 82 messages, 7 authors, 2016-06-15
STALE3738d

[PATCH v2 36/43] run-command: track total number of commands run

From: David Turner <hidden>
Date: 2016-06-15 23:06:43
Subsystem: the rest · Maintainer: Linus Torvalds

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 <redacted>
---
 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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help