summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/base.h9
-rw-r--r--src/buffer.c2
-rw-r--r--src/fdevent.c2
-rw-r--r--src/fdevent_select.c3
-rw-r--r--src/h2.h10
-rw-r--r--src/log.c6
-rw-r--r--src/mod_cml.c1
-rw-r--r--src/mod_cml_funcs.c1
-rw-r--r--src/mod_cml_lua.c1
-rw-r--r--src/mod_deflate.c2
-rw-r--r--src/mod_magnet_cache.c2
-rw-r--r--src/mod_rrdtool.c2
-rw-r--r--src/network.c2
-rw-r--r--src/rand.c2
-rw-r--r--src/request.h2
-rw-r--r--src/response.c2
-rw-r--r--src/response.h4
-rw-r--r--src/server.c3
-rw-r--r--src/stat_cache.h7
19 files changed, 18 insertions, 45 deletions
diff --git a/src/base.h b/src/base.h
index 652cf2ef..db83c7dd 100644
--- a/src/base.h
+++ b/src/base.h
@@ -2,14 +2,7 @@
#define _BASE_H_
#include "first.h"
-#include <sys/types.h>
-#include <sys/time.h>
-
-#if defined(__APPLE__) && defined(__MACH__)
-#if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 1050
-#include <time.h>
-#endif
-#endif
+#include "sys-time.h"
#include "base_decls.h"
#include "buffer.h"
diff --git a/src/buffer.c b/src/buffer.c
index 8729b5ed..a7b3974d 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -4,7 +4,7 @@
#include <stdlib.h>
#include <string.h>
-#include <time.h> /* strftime() */
+#include "sys-time.h" /* strftime() */
static const char hex_chars_lc[] = "0123456789abcdef";
static const char hex_chars_uc[] = "0123456789ABCDEF";
diff --git a/src/fdevent.c b/src/fdevent.c
index b27aea29..d9795134 100644
--- a/src/fdevent.c
+++ b/src/fdevent.c
@@ -7,13 +7,13 @@
#include <sys/types.h>
#include "sys-socket.h"
+#include "sys-time.h"
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <fcntl.h>
-#include <time.h>
#ifdef SOCK_CLOEXEC
static int use_sock_cloexec;
diff --git a/src/fdevent_select.c b/src/fdevent_select.c
index 080f1168..ff67815d 100644
--- a/src/fdevent_select.c
+++ b/src/fdevent_select.c
@@ -4,9 +4,8 @@
#include "fdevent.h"
#include "buffer.h"
-#include <sys/time.h>
+#include "sys-time.h"
-#include <unistd.h>
#include <stdlib.h>
#include <string.h>
diff --git a/src/h2.h b/src/h2.h
index eebb0981..d32fc466 100644
--- a/src/h2.h
+++ b/src/h2.h
@@ -2,15 +2,7 @@
#define LI_H2_H
#include "first.h"
-/* time_t */
-#include <sys/types.h>
-#include <sys/time.h>
-
-#if defined(__APPLE__) && defined(__MACH__)
-#if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 1050
-#include <time.h>
-#endif
-#endif
+#include "sys-time.h"
#include "base_decls.h"
#include "buffer.h"
diff --git a/src/log.c b/src/log.c
index fc1f9d12..99f91e8b 100644
--- a/src/log.c
+++ b/src/log.c
@@ -20,12 +20,6 @@
# include <syslog.h>
#endif
-#ifndef HAVE_CLOCK_GETTIME
-#ifdef HAVE_SYS_TIME_H
-# include <sys/time.h> /* gettimeofday() */
-#endif
-#endif
-
time_t log_epoch_secs = 0;
time_t log_monotonic_secs = 0;
diff --git a/src/mod_cml.c b/src/mod_cml.c
index fdfe23e3..566a8a6a 100644
--- a/src/mod_cml.c
+++ b/src/mod_cml.c
@@ -8,7 +8,6 @@
#include "plugin.h"
#include <sys/stat.h>
-#include <time.h>
#include <stdlib.h>
#include <string.h>
diff --git a/src/mod_cml_funcs.c b/src/mod_cml_funcs.c
index ce4ea54d..36dd50aa 100644
--- a/src/mod_cml_funcs.c
+++ b/src/mod_cml_funcs.c
@@ -1,7 +1,6 @@
#include "first.h"
#include <sys/stat.h>
-#include <time.h>
#include <stdlib.h>
#include <string.h>
diff --git a/src/mod_cml_lua.c b/src/mod_cml_lua.c
index 6f169873..f9786e4d 100644
--- a/src/mod_cml_lua.c
+++ b/src/mod_cml_lua.c
@@ -5,7 +5,6 @@
#include <lauxlib.h>
#include <errno.h>
-#include <time.h>
#include <string.h>
#include "mod_cml_funcs.h"
diff --git a/src/mod_deflate.c b/src/mod_deflate.c
index 9abc4641..367ffa32 100644
--- a/src/mod_deflate.c
+++ b/src/mod_deflate.c
@@ -101,12 +101,12 @@
#include <sys/types.h>
#include <sys/stat.h>
#include "sys-mmap.h"
+#include "sys-time.h"
#include <fcntl.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
-#include <time.h>
#include <unistd.h> /* getpid() read() unlink() write() */
#include "base.h"
diff --git a/src/mod_magnet_cache.c b/src/mod_magnet_cache.c
index b41001a3..67b726a9 100644
--- a/src/mod_magnet_cache.c
+++ b/src/mod_magnet_cache.c
@@ -4,8 +4,8 @@
#include "log.h"
#include "stat_cache.h"
+#include "sys-time.h"
#include <stdlib.h>
-#include <time.h>
#include <lualib.h>
#include <lauxlib.h>
diff --git a/src/mod_rrdtool.c b/src/mod_rrdtool.c
index d23a330c..45017697 100644
--- a/src/mod_rrdtool.c
+++ b/src/mod_rrdtool.c
@@ -7,13 +7,13 @@
#include "plugin.h"
#include <sys/types.h>
#include <sys/stat.h>
+#include "sys-time.h"
#include <fcntl.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <errno.h>
-#include <time.h>
typedef struct {
const buffer *path_rrd;
diff --git a/src/network.c b/src/network.c
index d4792fa3..8831410b 100644
--- a/src/network.c
+++ b/src/network.c
@@ -13,7 +13,7 @@
#include <sys/types.h>
#include <sys/stat.h>
-#include <sys/time.h>
+#include "sys-time.h"
#include <errno.h>
#include <fcntl.h>
diff --git a/src/rand.c b/src/rand.c
index 71645ac9..8d5c8ea9 100644
--- a/src/rand.c
+++ b/src/rand.c
@@ -13,11 +13,11 @@
#include <sys/types.h>
#include <sys/stat.h>
+#include "sys-time.h"
#include <errno.h>
#include <fcntl.h>
#include <stdlib.h>
#include <string.h>
-#include <time.h>
#include <unistd.h>
#include "sys-crypto-md.h" /* USE_LIB_CRYPTO and additional crypto lib config */
diff --git a/src/request.h b/src/request.h
index a9301f4e..a3c891b0 100644
--- a/src/request.h
+++ b/src/request.h
@@ -2,7 +2,7 @@
#define _REQUEST_H_
#include "first.h"
-#include <time.h> /* (struct timespec) */
+#include "sys-time.h" /* (struct timespec) */
#include "base_decls.h"
#include "buffer.h"
diff --git a/src/response.c b/src/response.c
index 9b79943e..c88ef9a8 100644
--- a/src/response.c
+++ b/src/response.c
@@ -17,12 +17,12 @@
#include <sys/types.h>
#include <sys/stat.h>
+#include "sys-time.h"
#include <limits.h>
#include <errno.h>
#include <stdlib.h>
#include <string.h>
-#include <time.h>
int
diff --git a/src/response.h b/src/response.h
index 50dace5b..05a7a1fc 100644
--- a/src/response.h
+++ b/src/response.h
@@ -2,12 +2,12 @@
#define _RESPONSE_H_
#include "first.h"
+#include "sys-time.h"
+
#include "base_decls.h"
#include "buffer.h"
#include "array.h"
-#include <time.h>
-
int http_response_parse(server *srv, request_st *r);
enum {
diff --git a/src/server.c b/src/server.c
index 97621635..5d938bc8 100644
--- a/src/server.c
+++ b/src/server.c
@@ -29,15 +29,14 @@
static const buffer default_server_tag = { CONST_STR_LEN(PACKAGE_DESC)+1, 0 };
#include <sys/types.h>
-#include <sys/time.h>
#include <sys/stat.h>
+#include "sys-time.h"
#include <string.h>
#include <errno.h>
#include <fcntl.h>
#include <unistd.h>
#include <stdlib.h>
-#include <time.h>
#include <signal.h>
#include <locale.h>
diff --git a/src/stat_cache.h b/src/stat_cache.h
index 62e42c69..42bd1ab2 100644
--- a/src/stat_cache.h
+++ b/src/stat_cache.h
@@ -2,14 +2,13 @@
#define _FILE_CACHE_H_
#include "first.h"
+#include <sys/stat.h>
+#include "sys-time.h"
+
#include "base_decls.h"
#include "buffer.h"
#include "array.h"
-#include <sys/types.h>
-#include <sys/time.h>
-#include <sys/stat.h>
-
typedef struct stat stat_cache_st;
typedef struct stat_cache_entry {