- deraadt@cvs.openbsd.org 2001/02/12 22:56:09
[clientloop.c packet.c ssh-keyscan.c]
deal with EAGAIN/EINTR selects which were skipped
diff --git a/clientloop.c b/clientloop.c
index e892c1a..547ccab 100644
--- a/clientloop.c
+++ b/clientloop.c
@@ -59,7 +59,7 @@
*/
#include "includes.h"
-RCSID("$OpenBSD: clientloop.c,v 1.49 2001/02/08 19:30:51 itojun Exp $");
+RCSID("$OpenBSD: clientloop.c,v 1.51 2001/02/13 21:51:09 markus Exp $");
#include "ssh.h"
#include "ssh1.h"
@@ -406,6 +406,15 @@
if (select((*maxfdp)+1, *readsetp, *writesetp, NULL, NULL) < 0) {
char buf[100];
+
+ /*
+ * We have to clear the select masks, because we return.
+ * We have to return, because the mainloop checks for the flags
+ * set by the signal handlers.
+ */
+ memset(*readsetp, 0, *maxfdp);
+ memset(*writesetp, 0, *maxfdp);
+
if (errno == EINTR)
return;
/* Note: we might still have data in the buffers. */