X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=run-command.h;h=44f7d2bd42ddcf2d65722b7e54bea69645d167a2;hb=38ca63f3c0ef70ba4e41d3b5e347e2c7e7d67fe5;hp=94619f52d95888b320664b7f19db3eeb7d6d8cca;hpb=c444c16589f95ac22d8e3ffe603cd7f0613512ce;p=git.git diff --git a/run-command.h b/run-command.h index 94619f52d..44f7d2bd4 100644 --- a/run-command.h +++ b/run-command.h @@ -1,6 +1,10 @@ #ifndef RUN_COMMAND_H #define RUN_COMMAND_H +#ifndef NO_PTHREADS +#include +#endif + struct child_process { const char **argv; pid_t pid; @@ -34,6 +38,7 @@ struct child_process { unsigned silent_exec_failure:1; unsigned stdout_to_stderr:1; unsigned use_shell:1; + unsigned clean_on_exit:1; void (*preexec_cb)(void); }; @@ -48,6 +53,7 @@ extern int run_hook(const char *index_file, const char *name, ...); #define RUN_COMMAND_STDOUT_TO_STDERR 4 #define RUN_SILENT_EXEC_FAILURE 8 #define RUN_USING_SHELL 16 +#define RUN_CLEAN_ON_EXIT 32 int run_command_v_opt(const char **argv, int opt); /* @@ -74,10 +80,10 @@ struct async { void *data; int in; /* caller writes here and closes it */ int out; /* caller reads from here and closes it */ -#ifndef WIN32 +#ifdef NO_PTHREADS pid_t pid; #else - HANDLE tid; + pthread_t tid; int proc_in; int proc_out; #endif