summaryrefslogtreecommitdiffstats
path: root/agent/call-pinentry.c
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2007-07-16 11:53:47 +0200
committerWerner Koch <wk@gnupg.org>2007-07-16 11:53:47 +0200
commitbce4ea798a87ee7f8f9ea3a930c3e53a321a8622 (patch)
tree0bc6721aca978df8abb44686daa5c81b98f6d69c /agent/call-pinentry.c
parentTranslate all file descriptors received from assuan. (diff)
downloadgnupg2-bce4ea798a87ee7f8f9ea3a930c3e53a321a8622.tar.xz
gnupg2-bce4ea798a87ee7f8f9ea3a930c3e53a321a8622.zip
Properly close files opened by es_fopen.
Allow setting of an empty passphrase. Assorted W32 changes.
Diffstat (limited to 'agent/call-pinentry.c')
-rw-r--r--agent/call-pinentry.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/agent/call-pinentry.c b/agent/call-pinentry.c
index 6d577ba02..ee01b4e15 100644
--- a/agent/call-pinentry.c
+++ b/agent/call-pinentry.c
@@ -206,12 +206,22 @@ start_pinentry (ctrl_t ctrl)
if (opt.verbose)
log_info ("starting a new PIN Entry\n");
-
+
+#ifdef HAVE_W32_SYSTEM
+ fflush (stdout);
+ fflush (stderr);
+#endif
if (fflush (NULL))
{
gpg_error_t tmperr = gpg_error (gpg_err_code_from_errno (errno));
log_error ("error flushing pending output: %s\n", strerror (errno));
+ /* At least Windows XP fails here with EBADF. According to docs
+ and Wine an fflush(NULL) is the same as _flushall. However
+ the Wime implementaion does not flush stdin,stdout and stderr
+ - see above. Lets try to ignore the error. */
+#ifndef HAVE_W32_SYSTEM
return unlock_pinentry (tmperr);
+#endif
}
if (!opt.pinentry_program || !*opt.pinentry_program)