aboutsummaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2008-01-27 14:43:52 +0000
committerWerner Koch <[email protected]>2008-01-27 14:43:52 +0000
commitd84d5ea748b2df0fd2fbd26149e8901e7fdd4af5 (patch)
tree9cffdf61c2bab8fdc9bfcc17548b0327c50661de /common
parentTypo fixes. (diff)
downloadgnupg-d84d5ea748b2df0fd2fbd26149e8901e7fdd4af5.tar.gz
gnupg-d84d5ea748b2df0fd2fbd26149e8901e7fdd4af5.zip
[W32] Avoid extra console window when importing or exporting.
Fixes bug 875.
Diffstat (limited to 'common')
-rw-r--r--common/ChangeLog5
-rw-r--r--common/exechelp.c12
-rw-r--r--common/exechelp.h7
3 files changed, 19 insertions, 5 deletions
diff --git a/common/ChangeLog b/common/ChangeLog
index b42bf9f4f..c01ab4307 100644
--- a/common/ChangeLog
+++ b/common/ChangeLog
@@ -1,3 +1,8 @@
+2008-01-27 Werner Koch <[email protected]>
+
+ * exechelp.c (gnupg_spawn_process): Add arg FLAGS and changed all
+ callers to pass 0 for it.
+
2007-12-13 Werner Koch <[email protected]>
* sexputil.c (hash_algo_from_sigval): New.
diff --git a/common/exechelp.c b/common/exechelp.c
index 7da7dbd50..09f90ef91 100644
--- a/common/exechelp.c
+++ b/common/exechelp.c
@@ -1,5 +1,5 @@
/* exechelp.c - fork and exec helpers
- * Copyright (C) 2004, 2007 Free Software Foundation, Inc.
+ * Copyright (C) 2004, 2007, 2008 Free Software Foundation, Inc.
*
* This file is part of GnuPG.
*
@@ -322,11 +322,18 @@ gnupg_create_inbound_pipe (int filedes[2])
PREEXEC is not NULL, that function will be called right before the
exec. Calling gnupg_wait_process is required.
+ FLAGS is a bit vector with just one bit defined for now:
+
+ Bit 7: If set the process will be started as a background process.
+ This flag is only useful under W32 systems, so that no new
+ console is created and pops up a console window when
+ starting the server
+
Returns 0 on success or an error code. */
gpg_error_t
gnupg_spawn_process (const char *pgmname, const char *argv[],
FILE *infile, FILE *outfile,
- void (*preexec)(void),
+ void (*preexec)(void), unsigned int flags,
FILE **statusfile, pid_t *pid)
{
#ifdef HAVE_W32_SYSTEM
@@ -384,6 +391,7 @@ gnupg_spawn_process (const char *pgmname, const char *argv[],
si.hStdError = fd_to_handle (rp[1]);
cr_flags = (CREATE_DEFAULT_ERROR_MODE
+ | ((flags & 128)? DETACHED_PROCESS : 0)
| GetPriorityClass (GetCurrentProcess ())
| CREATE_SUSPENDED);
log_debug ("CreateProcess, path=`%s' cmdline=`%s'\n", pgmname, cmdline);
diff --git a/common/exechelp.h b/common/exechelp.h
index 5dd7df4cf..0ad956f7a 100644
--- a/common/exechelp.h
+++ b/common/exechelp.h
@@ -30,13 +30,14 @@ gpg_error_t gnupg_create_inbound_pipe (int filedes[2]);
stdin, write the output to OUTFILE, return a new stream in
STATUSFILE for stderr and the pid of the process in PID. The
arguments for the process are expected in the NULL terminated array
- ARGV. The program name itself should not be included there. if
+ ARGV. The program name itself should not be included there. If
PREEXEC is not NULL, that function will be called right before the
- exec. Calling gnupg_wait_process is required. Returns 0 on
+ exec. FLAGS is currently only useful for W32, see the source for
+ details. Calling gnupg_wait_process is required. Returns 0 on
success or an error code. */
gpg_error_t gnupg_spawn_process (const char *pgmname, const char *argv[],
FILE *infile, FILE *outfile,
- void (*preexec)(void),
+ void (*preexec)(void), unsigned int flags,
FILE **statusfile, pid_t *pid);