* check whether the FD got fuxored meanwhile before adding it to the select set
authorWilfried Göesgens <willi@citadel.org>
Sat, 13 Feb 2010 00:01:30 +0000 (00:01 +0000)
committerWilfried Göesgens <willi@citadel.org>
Sat, 13 Feb 2010 00:01:30 +0000 (00:01 +0000)
citadel/sysdep.c

index d75b27773d0080fc40b09a8f7e59f151b0275eda..855b5bacad21dcb2aa97946104ba892b6f968c74 100644 (file)
@@ -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;