summaryrefslogtreecommitdiffstats
path: root/usr.bin/ssh/clientloop.c
diff options
context:
space:
mode:
authormarkus <markus@openbsd.org>2001-10-11 15:24:00 +0000
committermarkus <markus@openbsd.org>2001-10-11 15:24:00 +0000
commitf6c8ccac2ed93cf91115c765523c694e3754f017 (patch)
treecb4c97cfc2d29bf0d19330631d695c812c2e0215 /usr.bin/ssh/clientloop.c
parentFix flawed logic when deciding if we should sleep when (diff)
downloadwireguard-openbsd-f6c8ccac2ed93cf91115c765523c694e3754f017.tar.xz
wireguard-openbsd-f6c8ccac2ed93cf91115c765523c694e3754f017.zip
clear select masks if we return before calling select().
Diffstat (limited to 'usr.bin/ssh/clientloop.c')
-rw-r--r--usr.bin/ssh/clientloop.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/usr.bin/ssh/clientloop.c b/usr.bin/ssh/clientloop.c
index 43332d1f4a1..0e477bc7936 100644
--- a/usr.bin/ssh/clientloop.c
+++ b/usr.bin/ssh/clientloop.c
@@ -59,7 +59,7 @@
*/
#include "includes.h"
-RCSID("$OpenBSD: clientloop.c,v 1.83 2001/10/10 22:18:47 markus Exp $");
+RCSID("$OpenBSD: clientloop.c,v 1.84 2001/10/11 15:24:00 markus Exp $");
#include "ssh.h"
#include "ssh1.h"
@@ -343,9 +343,12 @@ client_wait_until_can_do_something(fd_set **readsetp, fd_set **writesetp,
FD_SET(fileno(stderr), *writesetp);
} else {
/* channel_prepare_select could have closed the last channel */
- if (session_closed && !channel_still_open()) {
- if (!packet_have_data_to_write())
- return;
+ if (session_closed && !channel_still_open() &&
+ !packet_have_data_to_write()) {
+ /* clear mask since we did not call select() */
+ memset(*readsetp, 0, *maxfdp);
+ memset(*writesetp, 0, *maxfdp);
+ return;
} else {
FD_SET(connection_in, *readsetp);
}