diff options
author | des <des@FreeBSD.org> | 2012-08-29 15:55:54 +0000 |
---|---|---|
committer | des <des@FreeBSD.org> | 2012-08-29 15:55:54 +0000 |
commit | 92ca7d86082c8566c36d7e641d345f4dc09ef6db (patch) | |
tree | 0fb8acbff73fddb3a95e864c5ddd6370367153a9 /serverloop.c | |
parent | a2352e45cfc1c57cda5e676028c6c4c012a39fef (diff) | |
download | FreeBSD-src-92ca7d86082c8566c36d7e641d345f4dc09ef6db.zip FreeBSD-src-92ca7d86082c8566c36d7e641d345f4dc09ef6db.tar.gz |
Vendor import of OpenSSH 6.1p1.
Diffstat (limited to 'serverloop.c')
-rw-r--r-- | serverloop.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/serverloop.c b/serverloop.c index 19b84ff..741c5be 100644 --- a/serverloop.c +++ b/serverloop.c @@ -1,4 +1,4 @@ -/* $OpenBSD: serverloop.c,v 1.160 2011/05/15 08:09:01 djm Exp $ */ +/* $OpenBSD: serverloop.c,v 1.162 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 @@ -281,9 +281,18 @@ wait_until_can_do_something(fd_set **readsetp, fd_set **writesetp, int *maxfdp, { struct timeval tv, *tvp; int ret; + time_t minwait_secs = 0; int client_alive_scheduled = 0; int program_alive_scheduled = 0; + /* Allocate and update select() masks for channel descriptors. */ + channel_prepare_select(readsetp, writesetp, maxfdp, nallocp, + &minwait_secs, 0); + + if (minwait_secs != 0) + max_time_milliseconds = MIN(max_time_milliseconds, + (u_int)minwait_secs * 1000); + /* * if using client_alive, set the max timeout accordingly, * and indicate that this particular timeout was for client @@ -298,9 +307,6 @@ wait_until_can_do_something(fd_set **readsetp, fd_set **writesetp, int *maxfdp, max_time_milliseconds = options.client_alive_interval * 1000; } - /* Allocate and update select() masks for channel descriptors. */ - channel_prepare_select(readsetp, writesetp, maxfdp, nallocp, 0); - if (compat20) { #if 0 /* wrong: bad condition XXX */ |