1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-06-03 22:48:03 +02:00

agent,w32: Fix annoying output to DebugView.

* agent/gpg-agent.c (startup_fd_list): Do not define for W32.
(main) [W32]: Do not call get_all_open_fds.
--

GnuPG-bug-id: 2267
Signed-off-by: Werner Koch <wk@gnupg.org>
This commit is contained in:
Werner Koch 2017-01-06 18:45:14 +01:00
parent e1f68337b9
commit 8d774904c8
No known key found for this signature in database
GPG Key ID: E3FDFF218E45B72B
2 changed files with 14 additions and 7 deletions

View File

@ -303,8 +303,10 @@ static int putty_support;
#endif /*HAVE_W32_SYSTEM*/ #endif /*HAVE_W32_SYSTEM*/
/* The list of open file descriptors at startup. Note that this list /* The list of open file descriptors at startup. Note that this list
has been allocated using the standard malloc. */ * has been allocated using the standard malloc. */
#ifndef HAVE_W32_SYSTEM
static int *startup_fd_list; static int *startup_fd_list;
#endif
/* The signal mask at startup and a flag telling whether it is valid. */ /* The signal mask at startup and a flag telling whether it is valid. */
#ifdef HAVE_SIGPROCMASK #ifdef HAVE_SIGPROCMASK
@ -949,8 +951,10 @@ main (int argc, char **argv )
/* Before we do anything else we save the list of currently open /* Before we do anything else we save the list of currently open
file descriptors and the signal mask. This info is required to file descriptors and the signal mask. This info is required to
do the exec call properly. */ do the exec call properly. We don't need it on Windows. */
#ifndef HAVE_W32_SYSTEM
startup_fd_list = get_all_open_fds (); startup_fd_list = get_all_open_fds ();
#endif /*!HAVE_W32_SYSTEM*/
#ifdef HAVE_SIGPROCMASK #ifdef HAVE_SIGPROCMASK
if (!sigprocmask (SIG_UNBLOCK, NULL, &startup_signal_mask)) if (!sigprocmask (SIG_UNBLOCK, NULL, &startup_signal_mask))
startup_signal_mask_valid = 1; startup_signal_mask_valid = 1;

View File

@ -128,11 +128,14 @@ close_all_fds (int first, int *except)
/* Returns an array with all currently open file descriptors. The end /* Returns an array with all currently open file descriptors. The end
of the array is marked by -1. The caller needs to release this * of the array is marked by -1. The caller needs to release this
array using the *standard free* and not with xfree. This allow the * array using the *standard free* and not with xfree. This allow the
use of this function right at startup even before libgcrypt has * use of this function right at startup even before libgcrypt has
been initialized. Returns NULL on error and sets ERRNO * been initialized. Returns NULL on error and sets ERRNO
accordingly. */ * accordingly. Note that fstat prints a warning to DebugView for all
* invalid fds which is a bit annoying. We actually do not need this
* function in real code (close_all_fds is a dummy anyway) but we keep
* it for use by t-exechelp.c. */
int * int *
get_all_open_fds (void) get_all_open_fds (void)
{ {