]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Fix compilation on OSX Sierra (10.12)
authorNick Mathewson <nickm@torproject.org>
Sat, 24 Sep 2016 15:48:47 +0000 (08:48 -0700)
committerNick Mathewson <nickm@torproject.org>
Sat, 24 Sep 2016 15:48:47 +0000 (08:48 -0700)
configure.ac
src/common/compat_pthreads.c
src/common/crypto.c

index 3c80e71c57d1df51a43bf7b82d74ad4c8418fc42..a799a55630ec8eb33ca33ea09561f148e8faa6a0 100644 (file)
@@ -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 \
index 1b24cc3c2a668874cae911f6a40e7dc6c5c9cd47..7640ebae34ce0758710edcdd26120756030c9c8a 100644 (file)
@@ -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)
index 2b96324d33e454a074717adc5e9a822f94175e9b..f147dbd71604ba66fd42c9fb9850f89a3daf1771 100644 (file)
@@ -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"