From: Bart Van Assche Date: Fri, 16 Jan 2009 11:57:50 +0000 (+0000) Subject: Obtain current time through time() instead of through clock_gettime(CLOCK_REALTIME... X-Git-Tag: svn/VALGRIND_3_5_0~1092 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2dd0d7d87f2bba2ce08eea58041a25968764a57c;p=thirdparty%2Fvalgrind.git Obtain current time through time() instead of through clock_gettime(CLOCK_REALTIME), such that this test compiles on systems that do not support CLOCK_REALTIME. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@8967 --- diff --git a/drd/tests/trylock.c b/drd/tests/trylock.c index 9c6dea2790..3db14edf34 100644 --- a/drd/tests/trylock.c +++ b/drd/tests/trylock.c @@ -22,7 +22,9 @@ int main(int argc, char** argv) pthread_rwlock_t rwlock; struct timespec abs_timeout; - r = clock_gettime(CLOCK_REALTIME, &abs_timeout); assert(r == 0); + time(&abs_timeout.tv_sec); + abs_timeout.tv_nsec = 0; + abs_timeout.tv_sec += 10; r = pthread_rwlock_init(&rwlock, NULL); assert(r == 0);