From: Art Cancro Date: Mon, 21 Mar 2011 15:50:28 +0000 (-0400) Subject: Modified select_on_master() to only have one code path to exit X-Git-Tag: v8.11~807 X-Git-Url: https://code.citadel.org/?p=citadel.git;a=commitdiff_plain;h=2c1aae859027f4ad1afa417f04417c7994b16130 Modified select_on_master() to only have one code path to exit --- diff --git a/citadel/sysdep.c b/citadel/sysdep.c index 9f1425bb2..ae46b479e 100644 --- a/citadel/sysdep.c +++ b/citadel/sysdep.c @@ -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; } diff --git a/citadel/textclient/screen.c b/citadel/textclient/screen.c index 5283431c3..67cd2f506 100644 --- a/citadel/textclient/screen.c +++ b/citadel/textclient/screen.c @@ -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 */