diff options
author | Markus Friedl <markus@cvs.openbsd.org> | 2001-02-13 21:51:10 +0000 |
---|---|---|
committer | Markus Friedl <markus@cvs.openbsd.org> | 2001-02-13 21:51:10 +0000 |
commit | daf640fcd3f72d3828949645a427bfce91fea321 (patch) | |
tree | 83c539f466ee960cf07cdd9a98ff300516ea5728 /usr.bin/ssh/clientloop.c | |
parent | 59e6d284a54e6c1969960fc43225728b18b3f73e (diff) |
clear select masks on EINTR, noticed by itojun@
Diffstat (limited to 'usr.bin/ssh/clientloop.c')
-rw-r--r-- | usr.bin/ssh/clientloop.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/usr.bin/ssh/clientloop.c b/usr.bin/ssh/clientloop.c index b77e8446b88..547ccabfe88 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.50 2001/02/12 22:56:08 deraadt Exp $"); +RCSID("$OpenBSD: clientloop.c,v 1.51 2001/02/13 21:51:09 markus Exp $"); #include "ssh.h" #include "ssh1.h" @@ -407,6 +407,14 @@ client_wait_until_can_do_something(fd_set **readsetp, fd_set **writesetp, 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. */ |