1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-12-22 10:19:57 +01:00

common,w32: Do not always print "Garbled console data" warning.

* common/init.c (_init_common_subsystems): Silence message.
--
This commit is contained in:
Werner Koch 2021-10-17 14:26:28 +02:00
parent 48359c7232
commit e293da3b21
No known key found for this signature in database
GPG Key ID: E3FDFF218E45B72B

View File

@ -208,9 +208,15 @@ _init_common_subsystems (gpg_err_source_t errsource, int *argcp, char ***argvp)
gettext_use_utf8 (1); gettext_use_utf8 (1);
if (!SetConsoleCP (CP_UTF8) || !SetConsoleOutputCP (CP_UTF8)) if (!SetConsoleCP (CP_UTF8) || !SetConsoleOutputCP (CP_UTF8))
{ {
log_info ("SetConsoleCP failed: %s\n", w32_strerror (-1)); /* Don't show the error if the program does not have a console.
* This is for example the case for daemons. */
in rc = GetLastError ();
if (rc != ERROR_INVALID_HANDLE)
{
log_info ("SetConsoleCP failed: %s\n", w32_strerror (rc));
log_info ("Warning: Garbled console data possible\n"); log_info ("Warning: Garbled console data possible\n");
} }
}
#endif #endif
/* Access the standard estreams as early as possible. If we don't /* Access the standard estreams as early as possible. If we don't