]> granicus.if.org Git - libevent/commitdiff
r15192@tombo: nickm | 2008-04-16 15:59:51 -0400
authorNick Mathewson <nickm@torproject.org>
Wed, 16 Apr 2008 20:01:27 +0000 (20:01 +0000)
committerNick Mathewson <nickm@torproject.org>
Wed, 16 Apr 2008 20:01:27 +0000 (20:01 +0000)
 Fix a compilation error on OSX.

svn:r710

test/regress_pthread.c

index 51b7ee820fb261e466369f37255fa3fb04b09b99..6e43ae7c8de4ab78def24d78ff7d547f7a487559 100644 (file)
@@ -158,7 +158,13 @@ free_lock(void *lock)
 static unsigned long
 get_id(void)
 {
-       return (unsigned long)(pthread_self());
+       union {
+               pthread_t thr;
+               unsigned long id;
+       } r;
+       r.id = 0;
+       r.thr = pthread_self();
+       return r.id;
 }
 
 void