aboutsummaryrefslogtreecommitdiffstats
path: root/tests/gpg/t-eventloop.c
diff options
context:
space:
mode:
authorDaiki Ueno <[email protected]>2016-02-09 08:03:51 +0000
committerWerner Koch <[email protected]>2016-09-22 07:12:43 +0000
commitd0cf6b15121c9b42dbcef243e5ce30c9996a449c (patch)
tree19504804055098446cf8ea4ddf446dfcac42bd24 /tests/gpg/t-eventloop.c
parentdoc: Fix minor errors in I/O callback example (diff)
downloadgpgme-d0cf6b15121c9b42dbcef243e5ce30c9996a449c.tar.gz
gpgme-d0cf6b15121c9b42dbcef243e5ce30c9996a449c.zip
tests: Fix select usage in t-eventloop
* tests/gpg/t-eventloop.c (do_select): Supply timeout value to select. Signed-off-by: Daiki Ueno <[email protected]>
Diffstat (limited to 'tests/gpg/t-eventloop.c')
-rw-r--r--tests/gpg/t-eventloop.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/tests/gpg/t-eventloop.c b/tests/gpg/t-eventloop.c
index 74af35fd..2d3df41a 100644
--- a/tests/gpg/t-eventloop.c
+++ b/tests/gpg/t-eventloop.c
@@ -111,6 +111,7 @@ do_select (void)
fd_set wfds;
int i, n;
int any = 0;
+ struct timeval tv;
FD_ZERO (&rfds);
FD_ZERO (&wfds);
@@ -118,9 +119,12 @@ do_select (void)
if (fdlist[i].fd != -1)
FD_SET (fdlist[i].fd, fdlist[i].dir ? &rfds : &wfds);
+ tv.tv_sec = 0;
+ tv.tv_usec = 1000;
+
do
{
- n = select (FD_SETSIZE, &rfds, &wfds, NULL, 0);
+ n = select (FD_SETSIZE, &rfds, &wfds, NULL, &tv);
}
while (n < 0 && errno == EINTR);