]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
helgrind/tests/cond_timedwait_invalid: Port to Darwin 10.8
authorBart Van Assche <bvanassche@acm.org>
Sun, 23 Oct 2011 12:11:15 +0000 (12:11 +0000)
committerBart Van Assche <bvanassche@acm.org>
Sun, 23 Oct 2011 12:11:15 +0000 (12:11 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12213

helgrind/tests/cond_timedwait_invalid.c

index c69ad2220ef830327e5ea2dafa9c523cb6d178bb..a8d0448d2fca799a6348d341f8068e1fae35b8e9 100644 (file)
@@ -1,3 +1,4 @@
+#include "config.h"
 #include <time.h>
 #include <pthread.h>
 #include <assert.h>
@@ -8,8 +9,13 @@ int main()
    struct timespec abstime;
    pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
    pthread_cond_t cond = PTHREAD_COND_INITIALIZER;
-   
+
+#ifdef HAVE_CLOCK_GETTIME
    assert(clock_gettime(CLOCK_REALTIME, &abstime)==0);
+#else
+   abstime.tv_sec = time(NULL) + 2;
+   abstime.tv_nsec = 0;
+#endif
    abstime.tv_nsec += 1000000000;
    
    assert(pthread_mutex_lock(&mutex)==0);