]> code.citadel.org Git - citadel.git/blobdiff - citadel/netproc.c
fix all the <time.h> vs. <sys/time.h> issues, hopefully
[citadel.git] / citadel / netproc.c
index b614d92ac580c7a1e1a9424b0eb48f8330d79f90..7645f4f8f41fa1fa299d526abec9bfd4b59ea334 100644 (file)
 #include <fcntl.h>
 #include <stdio.h>
 #include <ctype.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 <signal.h>
 #include <errno.h>
 #include <syslog.h>
@@ -408,7 +419,7 @@ void load_filterlist(void)
        fp = fopen("./network/filterlist", "r");
        if (fp == NULL)
                return;
-       while (fgets(sbuf, 256, fp) != NULL) {
+       while (fgets(sbuf, sizeof sbuf, fp) != NULL) {
                if (sbuf[0] != '#') {
                        sbuf[strlen(sbuf) - 1] = 0;
                        fbuf = (struct filterlist *)