]> code.citadel.org Git - citadel.git/blobdiff - citadel/userlist.c
fix all the <time.h> vs. <sys/time.h> issues, hopefully
[citadel.git] / citadel / userlist.c
index db120a9f16ec1f69a6151955bd192489a8caf448..bd59f04a582cf1f4cef04f742065eafa7740339a 100644 (file)
@@ -9,7 +9,18 @@
 #include <unistd.h>
 #include <stdio.h>
 #include <string.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 "citadel.h"
 #include <unistd.h>
 #include "ipc.h"
@@ -21,8 +32,8 @@ void logoff(int code)
        }
 
 void userlist(void) { 
-       char buf[256];
-       char fl[256];
+       char buf[SIZ];
+       char fl[SIZ];
        struct tm *tmbuf;
        time_t lc;
 
@@ -54,8 +65,8 @@ void userlist(void) {
 
 int main(int argc, char **argv)
 {
-       char buf[256];
-       char hostbuf[256], portbuf[256];
+       char buf[SIZ];
+       char hostbuf[SIZ], portbuf[SIZ];
 
        attach_to_server(argc, argv, hostbuf, portbuf);
        serv_gets(buf);