aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2022-08-03 09:11:22 +0000
committerWerner Koch <[email protected]>2022-08-03 09:12:16 +0000
commit6583abedf3f0ffe5cc8283fe683144fc1d5add40 (patch)
treef328a746f8b54dfbe2c539bdb7a6f2c2a9f0688d
parentdirmngr: Fix failed malloc error message. (diff)
downloadgnupg-6583abedf3f0ffe5cc8283fe683144fc1d5add40.tar.gz
gnupg-6583abedf3f0ffe5cc8283fe683144fc1d5add40.zip
common: Silence warnings from AllowSetForegroundWindow.
* common/sysutils.c (gnupg_allow_set_foregound_window): Print warning only with debug flag set.
-rw-r--r--common/sysutils.c8
-rw-r--r--doc/gpg.texi6
2 files changed, 12 insertions, 2 deletions
diff --git a/common/sysutils.c b/common/sysutils.c
index 01f654250..5f54ae155 100644
--- a/common/sysutils.c
+++ b/common/sysutils.c
@@ -779,8 +779,12 @@ gnupg_allow_set_foregound_window (pid_t pid)
"gnupg_allow_set_foregound_window", (unsigned long)pid);
#if defined(HAVE_W32_SYSTEM) && !defined(HAVE_W32CE_SYSTEM)
else if (!AllowSetForegroundWindow ((pid_t)pid == (pid_t)(-1)?ASFW_ANY:pid))
- log_info ("AllowSetForegroundWindow(%lu) failed: %s\n",
- (unsigned long)pid, w32_strerror (-1));
+ {
+ char *flags = getenv ("GNUPG_EXEC_DEBUG_FLAGS");
+ if (flags && (atoi (flags) & 2))
+ log_info ("AllowSetForegroundWindow(%lu) failed: %s\n",
+ (unsigned long)pid, w32_strerror (-1));
+ }
#endif
}
diff --git a/doc/gpg.texi b/doc/gpg.texi
index f51c3d9ec..39c996bd9 100644
--- a/doc/gpg.texi
+++ b/doc/gpg.texi
@@ -3818,6 +3818,12 @@ Operation is further controlled by a few environment variables:
under operating systems without proper support to figure out the
name of a process' text file.
+ @item GNUPG_EXEC_DEBUG_FLAGS
+ @efindex GNUPG_EXEC_DEBUG_FLAGS
+ This variable allows to enable diagnostics for process management.
+ A numeric decimal value is expected. Bit 0 enables general
+ diagnostics, bit 1 enables certain warnings on Windows.
+
@end table
When calling the gpg-agent component @command{@gpgname} sends a set of