aboutsummaryrefslogtreecommitdiffstats
path: root/gpgme/posix-io.c
diff options
context:
space:
mode:
Diffstat (limited to 'gpgme/posix-io.c')
-rw-r--r--gpgme/posix-io.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/gpgme/posix-io.c b/gpgme/posix-io.c
index d0fd5f8e..da7c106d 100644
--- a/gpgme/posix-io.c
+++ b/gpgme/posix-io.c
@@ -306,12 +306,14 @@ _gpgme_io_select (struct io_select_fd_s *fds, size_t nfds, int nonblock)
fd_set readfds;
fd_set writefds;
int any, i, max_fd, n, count;
- struct timeval timeout = { nonblock ? 0 : 1, 0 }; /* Use a 1s timeout. */
+ struct timeval timeout = { 1, 0 }; /* Use a 1s timeout. */
void *dbg_help = NULL;
FD_ZERO (&readfds);
FD_ZERO (&writefds);
max_fd = 0;
+ if (nonblock)
+ timeout.tv_sec = 0;
DEBUG_BEGIN (dbg_help, 3, "gpgme:select on [ ");
any = 0;