]> code.citadel.org Git - citadel.git/blobdiff - citadel/logging.c
* techdoc/delivery-list.txt: added (syntax for delivery lists)
[citadel.git] / citadel / logging.c
index e76827036967e4eed194b71f10d1eef6d5069bec..39a66c147f38ca688b0c83a6a45f6189bc7b5f71 100644 (file)
@@ -1,7 +1,9 @@
 /*
  * Everything which needs some logging...
+ * $Id$
  */
 
+#include "sysdep.h"
 #include <stdlib.h>
 #include <unistd.h>
 #include <stdio.h>
@@ -11,7 +13,6 @@
 #include <ctype.h>
 #include <string.h>
 #include <errno.h>
-#include <pthread.h>
 #include <syslog.h>
 #include "citadel.h"
 #include "server.h"
@@ -24,6 +25,8 @@ void rec_log(unsigned int lrtype, char *name) {
 
        time(&now);
        fp = fopen("citadel.log", "a");
-       fprintf(fp, "%ld|%u|%s\n", now, lrtype, name);
-       fclose(fp);
+       if (fp != NULL) {
+               fprintf(fp, "%ld|%u|%s\n", (long)now, lrtype, name);
+               fclose(fp);
        }
+}