]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Backport the other sierra fix in 20865.
authorNick Mathewson <nickm@torproject.org>
Wed, 7 Dec 2016 23:19:18 +0000 (18:19 -0500)
committerNick Mathewson <nickm@torproject.org>
Wed, 7 Dec 2016 23:24:28 +0000 (18:24 -0500)
They added clock_gettime(), but with tv_nsec as a long, whereas
tv_usec is a __darwin_suseconds_t (a.k.a. 'int').  Now, why would
they do that? Are they preparing for a world where there are more
than 2 billion nanoseconds per second?  Are they planning for having
int be less than 32 bits again?  Or are they just not paying
attention to the Darwin API?

Also, they forgot to mark clock_gettime() as Sierra-only, so even
if we fixed the issue here, we'd still be stick with portability
breakage like we were for 0.2.9.

So, just disable clock_gettime() on apple.

src/common/compat_pthreads.c

index 1b24cc3c2a668874cae911f6a40e7dc6c5c9cd47..962b5fc0e401d4e64ecf594137d4a24798f1c417 100644 (file)
 #include "torlog.h"
 #include "util.h"
 
+#ifdef __APPLE__
+#undef CLOCK_MONOTONIC
+#undef HAVE_CLOCK_GETTIME
+#endif
+
 /** Wraps a void (*)(void*) function and its argument so we can
  * invoke them in a way pthreads would expect.
  */