/*
- * Everything which needs some logging...
* $Id$
+ *
+ * Everything which needs some logging...
+ *
*/
+#ifdef DLL_EXPORT
+#define IN_LIBCIT
+#endif
+
#include "sysdep.h"
#include <stdlib.h>
#include <unistd.h>
#include <stdio.h>
#include <fcntl.h>
#include <signal.h>
-#include <time.h>
+
+#if TIME_WITH_SYS_TIME
+# include <sys/time.h>
+# include <time.h>
+#else
+# if HAVE_SYS_TIME_H
+# include <sys/time.h>
+# else
+# include <time.h>
+# endif
+#endif
+
#include <ctype.h>
#include <string.h>
#include <errno.h>
-#ifdef HAVE_PTHREAD_H
-#include <pthread.h>
-#endif
#include <syslog.h>
#include "citadel.h"
#include "server.h"
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);
}
+}