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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxxxx>
---
 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

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]