diff options
author | Nick Mathewson <nickm@torproject.org> | 2016-09-24 08:48:47 -0700 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2016-09-24 08:48:47 -0700 |
commit | 1eba088054eca1555b455ee4a2adfafecb888af9 (patch) | |
tree | bef23210c2d5872a01c73589f8fed0ed3ffaad48 | |
parent | ec19ecce4b553859b501c7279219e8a21549639a (diff) | |
download | tor-1eba088054eca1555b455ee4a2adfafecb888af9.tar.gz tor-1eba088054eca1555b455ee4a2adfafecb888af9.zip |
Fix compilation on OSX Sierra (10.12)
-rw-r--r-- | configure.ac | 1 | ||||
-rw-r--r-- | src/common/compat_pthreads.c | 2 | ||||
-rw-r--r-- | src/common/crypto.c | 3 |
3 files changed, 5 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac index 3c80e71c57..a799a55630 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 1b24cc3c2a..7640ebae34 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 2b96324d33..f147dbd716 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" |