]> code.citadel.org Git - citadel.git/blobdiff - citadel/sysdep.c
* Changed the comments at the beginning of each file to a consistent format
[citadel.git] / citadel / sysdep.c
index c3fde152eef5e97415044f9078700580ebd0fe0d..b4d46c2e22fc0a6d207752e9218a8eccc7ac41c4 100644 (file)
@@ -1,14 +1,15 @@
 /*
+ * $Id$
+ *
  * Citadel/UX "system dependent" stuff.
  * See copyright.txt for copyright information.
  *
- * $Id$
- *
- * Here's where we (hopefully) have all the parts of the Citadel server that
+ * Here's where we (hopefully) have most parts of the Citadel server that
  * would need to be altered to run the server in a non-POSIX environment.
  * 
  * Eventually we'll try porting to a different platform and either have
  * multiple variants of this file or simply load it up with #ifdefs.
+ *
  */
 
 
@@ -871,14 +872,14 @@ int main(int argc, char **argv)
        /*
         * Bind the server to our favorite ports.
         */
-       CtdlRegisterServiceHook(config.c_port_number,           /* TCP */
-                               NULL,
-                               citproto_begin_session,
-                               do_command_loop);
        CtdlRegisterServiceHook(0,                              /* Unix */
                                "citadel.socket",
                                citproto_begin_session,
                                do_command_loop);
+       CtdlRegisterServiceHook(config.c_port_number,           /* TCP */
+                               NULL,
+                               citproto_begin_session,
+                               do_command_loop);
 
        /*
         * Load any server-side modules (plugins) available here.
@@ -915,6 +916,8 @@ int main(int argc, char **argv)
 
        for (serviceptr = ServiceHookTable; serviceptr != NULL;
            serviceptr = serviceptr->next ) {
+               lprintf(9, "Will listen on master socket %d\n",
+                       serviceptr->msock);
                FD_SET(serviceptr->msock, &masterfds);
                if (serviceptr->msock > masterhighest) {
                        masterhighest = serviceptr->msock;
@@ -1096,7 +1099,10 @@ SETUP_FD:        memcpy(&readfds, &masterfds, sizeof(fd_set) );
                 * thread that the &readfds needs to be refreshed with more
                 * current data.
                 */
-               if (!time_to_die) if (FD_ISSET(rescan[0], &readfds)) {
+               if (time_to_die)
+                       break;
+
+               if (FD_ISSET(rescan[0], &readfds)) {
                        read(rescan[0], &junk, 1);
                        goto SETUP_FD;
                }