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 <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
b0320eaf6a
commit
ccf08bc3d0
@ -42,6 +42,7 @@ struct child_process {
|
||||
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 *);
|
||||
|
Reference in New Issue
Block a user