Tue Aug 18 00:42:33 EDT 1998 Nathan Bryant <bryant@cs.usm.maine.edu>
[citadel.git] / citadel / sysdep.c
index fa15477e0d1cd6a0ba008a4612949626365dacbb..c2ebc5f8eaad89e97005cccfb54bb391d10dd719 100644 (file)
@@ -32,6 +32,8 @@
 #include "citadel.h"
 #include "server.h"
 #include "proto.h"
+#include "sysdep_decls.h"
+#include "citserver.h"
 
 #ifdef NEED_SELECT_H
 #include <sys/select.h>
@@ -93,10 +95,10 @@ void init_sysdep(void) {
         * The action for unexpected signals and exceptions should be to
         * call master_cleanup() to gracefully shut down the server.
         */
-       signal(SIGINT, master_cleanup);
-       signal(SIGQUIT, master_cleanup);
-       signal(SIGHUP, master_cleanup);
-       signal(SIGTERM, master_cleanup);
+       signal(SIGINT, (void(*)(int))master_cleanup);
+       signal(SIGQUIT, (void(*)(int))master_cleanup);
+       signal(SIGHUP, (void(*)(int))master_cleanup);
+       signal(SIGTERM, (void(*)(int))master_cleanup);
        }
 
 
@@ -229,6 +231,7 @@ struct CitContext *CreateNewContext(void) {
                lprintf(1, "citserver: can't allocate memory!!\n");
                pthread_exit(NULL);
                }
+       bzero(me, sizeof(struct CitContext));
 
        begin_critical_section(S_SESSION_TABLE);
        me->next = ContextList;
@@ -428,7 +431,7 @@ int client_gets(char *buf)
  * The system-dependent part of master_cleanup() - close the master socket.
  */
 void sysdep_master_cleanup(void) {
-       lprintf(3, "Closing master socket %d\n", msock);
+       lprintf(7, "Closing master socket %d\n", msock);
        close(msock);
        }