* Header file adjustments to make it work on FreeBSD
[citadel.git] / webcit / tools.c
index d85e47ed7328b2bc55084ab6f18332abe80c1015..86fd68ec1e351f47eeddf8fc8e98fac886f32478 100644 (file)
@@ -6,16 +6,25 @@
 
 #include <ctype.h>
 #include <stdlib.h>
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>
+#endif
 #include <stdio.h>
+#ifdef HAVE_FCNTL_H
 #include <fcntl.h>
+#endif
 #include <signal.h>
 #include <sys/types.h>
 #include <sys/wait.h>
 #include <sys/socket.h>
+#ifdef HAVE_SYS_TIME_H
 #include <sys/time.h>
+#endif
+#ifdef HAVE_LIMITS_H
 #include <limits.h>
+#endif
 #include <netinet/in.h>
+#include <arpa/inet.h>
 #include <netdb.h>
 #include <string.h>
 #include <pwd.h>
 #include <stdarg.h>
 #include <pthread.h>
 #include <signal.h>
-#include <sys/time.h>
 #include "webcit.h"
 #include "webserver.h"
 
+
 typedef unsigned char byte;
 
 #define FALSE 0
@@ -479,7 +488,7 @@ void generate_uuid(char *buf) {
 
        sprintf(buf, "%s-%lx-%x-%x",
                serv_info.serv_nodename,
-               time(NULL),
+               (long)time(NULL),
                getpid(),
                (seq++)
        );