diff options
Diffstat (limited to 'common')
-rw-r--r-- | common/exechelp-posix.c | 12 | ||||
-rw-r--r-- | common/exechelp-w32.c | 6 | ||||
-rw-r--r-- | common/exechelp.h | 2 | ||||
-rw-r--r-- | common/exectool.c | 2 |
4 files changed, 8 insertions, 14 deletions
diff --git a/common/exechelp-posix.c b/common/exechelp-posix.c index b4d10bf65..54fe7dbac 100644 --- a/common/exechelp-posix.c +++ b/common/exechelp-posix.c @@ -277,7 +277,7 @@ get_all_open_fds (void) static void do_exec (const char *pgmname, const char *argv[], int fd_in, int fd_out, int fd_err, - int *except, void (*preexec)(void), unsigned int flags) + int *except, unsigned int flags) { char **arg_list; int i, j; @@ -334,8 +334,6 @@ do_exec (const char *pgmname, const char *argv[], /* Close all other files. */ close_all_fds (3, except); - if (preexec) - preexec (); execv (pgmname, arg_list); /* No way to print anything, as we have closed all streams. */ _exit (127); @@ -437,7 +435,7 @@ gnupg_close_pipe (int fd) /* Fork and exec the PGMNAME, see exechelp.h for details. */ gpg_error_t gnupg_spawn_process (const char *pgmname, const char *argv[], - int *except, void (*preexec)(void), unsigned int flags, + int *except, unsigned int flags, estream_t *r_infp, estream_t *r_outfp, estream_t *r_errfp, @@ -544,7 +542,7 @@ gnupg_spawn_process (const char *pgmname, const char *argv[], es_fclose (outfp); es_fclose (errfp); do_exec (pgmname, argv, inpipe[0], outpipe[1], errpipe[1], - except, preexec, flags); + except, flags); /*NOTREACHED*/ } @@ -594,7 +592,7 @@ gnupg_spawn_process_fd (const char *pgmname, const char *argv[], { gcry_control (GCRYCTL_TERM_SECMEM); /* Run child. */ - do_exec (pgmname, argv, infd, outfd, errfd, NULL, NULL, 0); + do_exec (pgmname, argv, infd, outfd, errfd, NULL, 0); /*NOTREACHED*/ } @@ -893,7 +891,7 @@ gnupg_spawn_process_detached (const char *pgmname, const char *argv[], for (i=0; envp[i]; i++) putenv (xstrdup (envp[i])); - do_exec (pgmname, argv, -1, -1, -1, NULL, NULL, 0); + do_exec (pgmname, argv, -1, -1, -1, NULL, 0); /*NOTREACHED*/ } diff --git a/common/exechelp-w32.c b/common/exechelp-w32.c index 19cf85c85..aeedbbf2d 100644 --- a/common/exechelp-w32.c +++ b/common/exechelp-w32.c @@ -410,7 +410,7 @@ gnupg_close_pipe (int fd) /* Fork and exec the PGMNAME, see exechelp.h for details. */ gpg_error_t gnupg_spawn_process (const char *pgmname, const char *argv[], - int *except, void (*preexec)(void), unsigned int flags, + int *except, unsigned int flags, estream_t *r_infp, estream_t *r_outfp, estream_t *r_errfp, @@ -564,10 +564,6 @@ gnupg_spawn_process (const char *pgmname, const char *argv[], nullhd[2] = ((flags & GNUPG_SPAWN_KEEP_STDOUT)? GetStdHandle (STD_ERROR_HANDLE) : w32_open_null (1)); - /* Start the process. Note that we can't run the PREEXEC function - because this might change our own environment. */ - (void)preexec; - memset (&si, 0, sizeof si); si.cb = sizeof (si); si.dwFlags = STARTF_USESTDHANDLES | STARTF_USESHOWWINDOW; diff --git a/common/exechelp.h b/common/exechelp.h index 735ea4728..3343fe598 100644 --- a/common/exechelp.h +++ b/common/exechelp.h @@ -133,7 +133,7 @@ void gnupg_close_pipe (int fd); */ gpg_error_t gnupg_spawn_process (const char *pgmname, const char *argv[], - int *execpt, void (*preexec)(void), unsigned int flags, + int *execpt, unsigned int flags, estream_t *r_infp, estream_t *r_outfp, estream_t *r_errfp, diff --git a/common/exectool.c b/common/exectool.c index 8013ba1cc..aaf5898d0 100644 --- a/common/exectool.c +++ b/common/exectool.c @@ -412,7 +412,7 @@ gnupg_exec_tool_stream (const char *pgmname, const char *argv[], exceptclose[0] = -1; err = gnupg_spawn_process (pgmname, argv, - exceptclose, NULL, GNUPG_SPAWN_NONBLOCK, + exceptclose, GNUPG_SPAWN_NONBLOCK, input? &infp : NULL, &outfp, &errfp, &pid); if (extrapipe[0] != -1) |