Modified select_on_master() to only have one code path to exit
authorArt Cancro <ajc@citadel.org>
Mon, 21 Mar 2011 15:50:28 +0000 (11:50 -0400)
committerWilfried Goesgens <dothebart@citadel.org>
Sun, 4 Sep 2011 17:17:43 +0000 (17:17 +0000)
citadel/sysdep.c
citadel/textclient/screen.c

index 9f1425bb2ac55b4011ebfb85955c2b2e70da09b4..ae46b479ea1ca9515c24bc84d973dd7e08478f5f 100644 (file)
@@ -1354,8 +1354,9 @@ void *select_on_master(void *blah)
                        tv.tv_usec = 0;
                        retval = select(highest + 1, &master_fds, NULL, NULL, &tv);
                }
-               else
-                       return NULL;
+               else {
+                       retval = -1 ;
+               }
 
                /* Now figure out who made this select() unblock.
                 * First, check for an error or exit condition.
@@ -1377,15 +1378,11 @@ void *select_on_master(void *blah)
                                continue;
                        }
                }
-               else if(retval == 0) {
-                       if (server_shutting_down) return(NULL);
-                       continue;
-               }
+
                /* Next, check to see if it's a new client connecting
                 * on a master socket.
                 */
-               else for (serviceptr = ServiceHookTable; serviceptr != NULL;
-                    serviceptr = serviceptr->next ) {
+               else if ((retval > 0) && (!server_shutting_down)) for (serviceptr = ServiceHookTable; serviceptr != NULL; serviceptr = serviceptr->next) {
 
                        if (FD_ISSET(serviceptr->msock, &master_fds)) {
                                ssock = accept(serviceptr->msock, NULL, 0);
@@ -1431,7 +1428,6 @@ void *select_on_master(void *blah)
                }
        }
        CtdlClearSystemContext();
-
        return NULL;
 }
 
index 5283431c3586698f2164976fb82ce2ed4b46d2cd..67cd2f506e56890c4637ff79552f6dff544464ff 100644 (file)
@@ -38,7 +38,7 @@
 #include "commands.h"
 #include "screen.h"
 
-int enable_status_line = 0;
+int enable_status_line = 0;    /* FIXME the status line works, but not on Mac.  Make this configurable. */
 char status_line[1024] = "     ";
 
 /* the default paginator prompt will be replaced by the server's prompt when we learn it */