summaryrefslogtreecommitdiff
path: root/clientloop.c
diff options
context:
space:
mode:
authorDag-Erling Smørgrav <des@FreeBSD.org>2012-08-29 15:55:54 +0000
committerDag-Erling Smørgrav <des@FreeBSD.org>2012-08-29 15:55:54 +0000
commit925f1fb7e466dbf645650dc4ea9d2a34e728ef9c (patch)
tree0fb8acbff73fddb3a95e864c5ddd6370367153a9 /clientloop.c
parent2e97a36905ba9936cb9972e37c5e56deb288e442 (diff)
Notes
Diffstat (limited to 'clientloop.c')
-rw-r--r--clientloop.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/clientloop.c b/clientloop.c
index f69a9b025d49..1c1a7708883c 100644
--- a/clientloop.c
+++ b/clientloop.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: clientloop.c,v 1.238 2012/01/18 21:46:43 dtucker Exp $ */
+/* $OpenBSD: clientloop.c,v 1.240 2012/06/20 04:42:58 djm Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -583,10 +583,12 @@ client_wait_until_can_do_something(fd_set **readsetp, fd_set **writesetp,
{
struct timeval tv, *tvp;
int timeout_secs;
+ time_t minwait_secs = 0;
int ret;
/* Add any selections by the channel mechanism. */
- channel_prepare_select(readsetp, writesetp, maxfdp, nallocp, rekeying);
+ channel_prepare_select(readsetp, writesetp, maxfdp, nallocp,
+ &minwait_secs, rekeying);
if (!compat20) {
/* Read from the connection, unless our buffers are full. */
@@ -639,6 +641,8 @@ client_wait_until_can_do_something(fd_set **readsetp, fd_set **writesetp,
if (timeout_secs < 0)
timeout_secs = 0;
}
+ if (minwait_secs != 0)
+ timeout_secs = MIN(timeout_secs, (int)minwait_secs);
if (timeout_secs == INT_MAX)
tvp = NULL;
else {