From 0078afb8c60af2c61c01688ca52f51ca95b25721 Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Wed, 19 Jun 2024 09:23:47 +0200 Subject: spawn: Keep struct definitions at the top of the file. * src/spawn-posix.c: Move include and struct defs around. * src/spawn-w32.c: Move struct defs around. --- src/spawn-w32.c | 40 ++++++++++++++++++++++++---------------- 1 file changed, 24 insertions(+), 16 deletions(-) (limited to 'src/spawn-w32.c') diff --git a/src/spawn-w32.c b/src/spawn-w32.c index 0e6b77d..e6ce28f 100644 --- a/src/spawn-w32.c +++ b/src/spawn-w32.c @@ -67,6 +67,30 @@ #define handle_to_fd(a) ((intptr_t)(a)) +/* Definition for the gpgrt_spawn_actions_t. Note that there is a + * different one for Unices. */ +struct gpgrt_spawn_actions { + void *hd[3]; + void **inherit_hds; + char *env; +}; + + +/* Definition for the gpgrt_process_t. Note that there is a different + * one for Unices. */ +struct gpgrt_process { + const char *pgmname; + unsigned int terminated:1; /* or detached */ + unsigned int flags; + HANDLE hProcess; + HANDLE hd_in; + HANDLE hd_out; + HANDLE hd_err; + int exitcode; +}; + + + /* Return the maximum number of currently allowed open file * descriptors. Only useful on POSIX systems but returns a value on * other systems too. */ @@ -301,22 +325,6 @@ _gpgrt_make_pipe (int filedes[2], estream_t *r_fp, int direction, int nonblock) return do_create_pipe_and_estream (filedes, NULL, 0, 0); } -struct gpgrt_spawn_actions { - void *hd[3]; - void **inherit_hds; - char *env; -}; - -struct gpgrt_process { - const char *pgmname; - unsigned int terminated :1; /* or detached */ - unsigned int flags; - HANDLE hProcess; - HANDLE hd_in; - HANDLE hd_out; - HANDLE hd_err; - int exitcode; -}; /* * Check if STARTUPINFOEXW supports PROC_THREAD_ATTRIBUTE_HANDLE_LIST. -- cgit v1.2.3