From ccf08bc3d06050fbe9b76846f6e2ab6d1cd6bd09 Mon Sep 17 00:00:00 2001 From: Jeff King Date: Tue, 22 Jul 2008 03:12:46 -0400 Subject: run-command: add pre-exec callback This is a function provided by the caller which is called _after_ the process is forked, but before the spawned program is executed. On platforms (like mingw) where subprocesses are forked and executed in a single call, the preexec callback is simply ignored. This will be used in the following patch to do some setup for 'less' that must happen in the forked child. Signed-off-by: Jeff King Signed-off-by: Junio C Hamano --- run-command.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'run-command.c') diff --git a/run-command.c b/run-command.c index 6e29fdf9e..73d0c3127 100644 --- a/run-command.c +++ b/run-command.c @@ -110,6 +110,8 @@ int start_command(struct child_process *cmd) unsetenv(*cmd->env); } } + if (cmd->preexec_cb) + cmd->preexec_cb(); if (cmd->git_cmd) { execv_git_cmd(cmd->argv); } else { -- cgit v1.2.1