[tor-commits] [tor/master] Include sys/time.h in timers.c and time_fmt.c

nickm at torproject.org nickm at torproject.org
Tue Nov 6 20:17:56 UTC 2018


commit daaa2751ed6ea8fe6941b63ea819804d8f0a9fac
Author: Kris Katterjohn <katterjohn at gmail.com>
Date:   Sat Nov 3 14:28:27 2018 -0500

    Include sys/time.h in timers.c and time_fmt.c
    
    This fixes compilation on OpenBSD.
    
    Signed-off-by: Kris Katterjohn <katterjohn at gmail.com>
---
 src/lib/encoding/time_fmt.c | 4 ++++
 src/lib/evloop/timers.c     | 4 ++++
 2 files changed, 8 insertions(+)

diff --git a/src/lib/encoding/time_fmt.c b/src/lib/encoding/time_fmt.c
index a921fc681..233d0dddf 100644
--- a/src/lib/encoding/time_fmt.c
+++ b/src/lib/encoding/time_fmt.c
@@ -26,6 +26,10 @@
 #include <string.h>
 #include <time.h>
 
+#ifdef HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+
 #ifdef _WIN32
 /* For struct timeval */
 #include <winsock2.h>
diff --git a/src/lib/evloop/timers.c b/src/lib/evloop/timers.c
index c4e85c7c9..3603bf1a7 100644
--- a/src/lib/evloop/timers.c
+++ b/src/lib/evloop/timers.c
@@ -39,6 +39,10 @@
 #include "lib/malloc/malloc.h"
 #include "lib/time/compat_time.h"
 
+#ifdef HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+
 #ifdef _WIN32
 // For struct timeval.
 #include <winsock2.h>





More information about the tor-commits mailing list