[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [tor/master] Fix compilation on OSX Sierra (10.12)



commit 1eba088054eca1555b455ee4a2adfafecb888af9
Author: Nick Mathewson <nickm@xxxxxxxxxxxxxx>
Date:   Sat Sep 24 08:48:47 2016 -0700

    Fix compilation on OSX Sierra (10.12)
---
 configure.ac                 | 1 +
 src/common/compat_pthreads.c | 2 +-
 src/common/crypto.c          | 3 +++
 3 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index 3c80e71..a799a55 100644
--- a/configure.ac
+++ b/configure.ac
@@ -986,6 +986,7 @@ AC_CHECK_HEADERS(
         sys/mman.h \
         sys/param.h \
         sys/prctl.h \
+	sys/random.h \
         sys/resource.h \
         sys/select.h \
         sys/socket.h \
diff --git a/src/common/compat_pthreads.c b/src/common/compat_pthreads.c
index 1b24cc3..7640eba 100644
--- a/src/common/compat_pthreads.c
+++ b/src/common/compat_pthreads.c
@@ -247,7 +247,7 @@ tor_cond_wait(tor_cond_t *cond, tor_mutex_t *mutex, const struct timeval *tv)
         return -1;
       }
       tvnow.tv_sec = ts.tv_sec;
-      tvnow.tv_usec = ts.tv_nsec / 1000;
+      tvnow.tv_usec = (int)(ts.tv_nsec / 1000);
       timeradd(tv, &tvnow, &tvsum);
 #else
       if (gettimeofday(&tvnow, NULL) < 0)
diff --git a/src/common/crypto.c b/src/common/crypto.c
index 2b96324..f147dbd 100644
--- a/src/common/crypto.c
+++ b/src/common/crypto.c
@@ -77,6 +77,9 @@
 #ifdef HAVE_SYS_SYSCALL_H
 #include <sys/syscall.h>
 #endif
+#ifdef HAVE_SYS_RANDOM_H
+#include <sys/random.h>
+#endif
 
 #include "torlog.h"
 #include "aes.h"



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits