diff options
author | Werner Koch <[email protected]> | 2021-09-13 15:07:18 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2021-09-13 15:12:23 +0000 |
commit | 117afec018911a3b0187f15c8559f811a72ddb79 (patch) | |
tree | 3d9c53c21b657fd5a9bf467f9ba7ed92fb45665b | |
parent | doc: Clarify some gpg keyring options (diff) | |
download | gnupg-117afec018911a3b0187f15c8559f811a72ddb79.tar.gz gnupg-117afec018911a3b0187f15c8559f811a72ddb79.zip |
common: New envvar GNUPG_EXEC_DEBUG_FLAGS.
* common/exechelp-w32.c (gnupg_spawn_process_detached): Silence
breakaway messages and turn them again into debug messages.
-rw-r--r-- | common/exechelp-w32.c | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/common/exechelp-w32.c b/common/exechelp-w32.c index 4581ca8ce..bdbea318a 100644 --- a/common/exechelp-w32.c +++ b/common/exechelp-w32.c @@ -893,10 +893,14 @@ gnupg_spawn_process_detached (const char *pgmname, const char *argv[], BOOL in_job = FALSE; gpg_err_code_t ec; int rc; + int jobdebug; /* We don't use ENVP. */ (void)envp; + cmdline = getenv ("GNUPG_EXEC_DEBUG_FLAGS"); + jobdebug = (cmdline && (atoi (cmdline) & 1)); + if ((ec = gnupg_access (pgmname, X_OK))) return gpg_err_make (default_errsource, ec); @@ -945,24 +949,32 @@ gnupg_spawn_process_detached (const char *pgmname, const char *argv[], else if ((info.BasicLimitInformation.LimitFlags & JOB_OBJECT_LIMIT_BREAKAWAY_OK)) { - log_info ("Using CREATE_BREAKAWAY_FROM_JOB flag\n"); + if (jobdebug) + log_debug ("Using CREATE_BREAKAWAY_FROM_JOB flag\n"); cr_flags |= CREATE_BREAKAWAY_FROM_JOB; } else if ((info.BasicLimitInformation.LimitFlags & JOB_OBJECT_LIMIT_SILENT_BREAKAWAY_OK)) { /* The child process should automatically detach from the job. */ - log_info ("Not using CREATE_BREAKAWAY_FROM_JOB flag; " - "JOB_OBJECT_LIMIT_SILENT_BREAKAWAY_OK is set\n"); + if (jobdebug) + log_debug ("Not using CREATE_BREAKAWAY_FROM_JOB flag; " + "JOB_OBJECT_LIMIT_SILENT_BREAKAWAY_OK is set\n"); } else { /* It seems that the child process must remain in the job. * This is not necessarily an error, although it can cause premature * termination of the child process when the job is closed. */ - log_info ("Not using CREATE_BREAKAWAY_FROM_JOB flag\n"); + if (jobdebug) + log_debug ("Not using CREATE_BREAKAWAY_FROM_JOB flag\n"); } } + else + { + if (jobdebug) + log_debug ("Process is not in a Job\n"); + } /* log_debug ("CreateProcess(detached), path='%s' cmdline='%s'\n", */ /* pgmname, cmdline); */ |