# HG changeset patch # User Matt Johnston # Date 1165325324 0 # Node ID 87ae4565679de6fe8f8ca830914643d85fee8501 # Parent c046b66b76cda539d26a2ab909b5e48db571c3a7# Parent 70caa99bfe3a0b69f8d567b18bde09778a809751 merge of 'a94c5265558121fe936519b5d9a5eb27f95e9d9d' and 'd348546b80847bc0d42a7b5208bb31a54f1fdfaf' diff -r c046b66b76cd -r 87ae4565679d common-session.c --- a/common-session.c Thu Oct 12 03:01:10 2006 +0000 +++ b/common-session.c Tue Dec 05 13:28:44 2006 +0000 @@ -143,27 +143,21 @@ dropbear_exit("Terminated by signal"); } - if (val < 0) { - if (errno == EINTR) { - /* This must happen even if we've been interrupted, so that - * changed signal-handler vars can take effect etc */ - if (loophandler) { - loophandler(); - } - continue; - } else { - dropbear_exit("Error in select"); - } + if (val < 0 && errno != EINTR) { + dropbear_exit("Error in select"); + } + + if (val <= 0) { + /* If we were interrupted or the select timed out, we still + * want to iterate over channels etc for reading, to handle + * server processes exiting etc. + * We don't want to read/write FDs. */ + FD_ZERO(&writefd); + FD_ZERO(&readfd); } /* check for auth timeout, rekeying required etc */ checktimeouts(); - - if (val == 0) { - /* timeout */ - TRACE(("select timeout")) - continue; - } /* process session socket's incoming/outgoing data */ if (ses.sock != -1) {