From: Wilfried Göesgens Date: Sat, 13 Feb 2010 00:01:30 +0000 (+0000) Subject: * check whether the FD got fuxored meanwhile before adding it to the select set X-Git-Tag: v7.86~433 X-Git-Url: https://code.citadel.org/?a=commitdiff_plain;h=ee7c95aac36f4b6b5571be23dc6021f7c65cc61b;p=citadel.git * check whether the FD got fuxored meanwhile before adding it to the select set --- diff --git a/citadel/sysdep.c b/citadel/sysdep.c index d75b27773..855b5baca 100644 --- a/citadel/sysdep.c +++ b/citadel/sysdep.c @@ -970,7 +970,10 @@ do_select: force_purge = 0; begin_critical_section(S_SESSION_TABLE); for (ptr = ContextList; ptr != NULL; ptr = ptr->next) { /* Dont select on dead sessions only truly idle ones */ - if ((ptr->state == CON_IDLE) && (CC->kill_me == 0)) { + if ((ptr->state == CON_IDLE) && + (CC->kill_me == 0) && + (ptr->client_socket != -1)) + { FD_SET(ptr->client_socket, &readfds); if (ptr->client_socket > highest) highest = ptr->client_socket;