fix all the <time.h> vs. <sys/time.h> issues, hopefully
[citadel.git] / citadel / citserver.c
index c39c817eed4ca9924c6b2c56e1e1859537b1ada2..919156a6a4da8cf039cca909439df48b3b45809c 100644 (file)
 #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>
@@ -21,7 +32,6 @@
 #include <netdb.h>
 #include <sys/types.h>
 #include <sys/socket.h>
-#include <sys/time.h>
 #include <netinet/in.h>
 #include <arpa/inet.h>
 #include "citadel.h"