fix all the <time.h> vs. <sys/time.h> issues, hopefully
[citadel.git] / citadel / housekeeping.c
index 1f2fc70f36e3d0cc40f85e505c23df6ccfba9d84..2746b68de55126a7e4551c8f5f7e2e8bdd1c7b5a 100644 (file)
 #include <unistd.h>
 #include <stdio.h>
 #include <fcntl.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>
 #include <limits.h>
 #include <sys/types.h>
-#include <sys/time.h>
 #ifdef HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #endif