summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: b0320ea)
raw | patch | inline | side by side (parent: b0320ea)
author | Jeff King <peff@peff.net> | |
Tue, 22 Jul 2008 07:12:46 +0000 (03:12 -0400) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Sat, 26 Jul 2008 04:29:44 +0000 (21:29 -0700) |
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 <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
_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 <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
run-command.c | patch | blob | history | |
run-command.h | patch | blob | history |
diff --git a/run-command.c b/run-command.c
index 6e29fdf9e2968900d21ea48b992f292204621f19..73d0c312767191a2150b5223806c1733533bc5c2 100644 (file)
--- a/run-command.c
+++ b/run-command.c
unsetenv(*cmd->env);
}
}
+ if (cmd->preexec_cb)
+ cmd->preexec_cb();
if (cmd->git_cmd) {
execv_git_cmd(cmd->argv);
} else {
diff --git a/run-command.h b/run-command.h
index 5203a9ebb10b14bd06862abafed0ab73d7514a3d..4f2b7d7d403ee6d87fea5ba2dc32da7596965e5e 100644 (file)
--- a/run-command.h
+++ b/run-command.h
unsigned no_stderr:1;
unsigned git_cmd:1; /* if this is to be git sub-command */
unsigned stdout_to_stderr:1;
+ void (*preexec_cb)(void);
};
int start_command(struct child_process *);