Fix compilation on OSX Sierra (10.12)

This commit is contained in:
Nick Mathewson 2016-09-24 08:48:47 -07:00
parent ec19ecce4b
commit 1eba088054
3 changed files with 5 additions and 1 deletions

View 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 \

View 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)

View 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"