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

[tor-commits] [tor/maint-0.2.8] Backport the other sierra fix in 20865.



commit 10baf2c6845f93ade7d412ad27efb625e513160e
Author: Nick Mathewson <nickm@xxxxxxxxxxxxxx>
Date:   Wed Dec 7 18:19:18 2016 -0500

    Backport the other sierra fix in 20865.
    
    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 | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/common/compat_pthreads.c b/src/common/compat_pthreads.c
index 1b24cc3..962b5fc 100644
--- a/src/common/compat_pthreads.c
+++ b/src/common/compat_pthreads.c
@@ -21,6 +21,11 @@
 #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.
  */

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