From: Florian Krohm Date: Fri, 28 Oct 2011 00:11:44 +0000 (+0000) Subject: Rewrite test to not use function clock_gettime. The purpose X-Git-Tag: svn/VALGRIND_3_8_0~602 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b84e2153431f1ce3542dae032499b2aa4263473b;p=thirdparty%2Fvalgrind.git Rewrite test to not use function clock_gettime. The purpose of this is to not have to link against -lrt because that causes a different back-trace on certain x86 and s390x environments. See the thread with subject "helgrind/tests/cond_timedwait_invalid failing on x86" on valgrind-developers for more details. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12246 --- diff --git a/helgrind/tests/Makefile.am b/helgrind/tests/Makefile.am index 3271a54275..3ca723b72b 100644 --- a/helgrind/tests/Makefile.am +++ b/helgrind/tests/Makefile.am @@ -185,8 +185,3 @@ annotate_hbefore_CFLAGS = $(AM_CFLAGS) -mdynamic-no-pic else annotate_hbefore_CFLAGS = $(AM_CFLAGS) endif - -if VGCONF_OS_IS_LINUX -cond_timedwait_invalid_LDADD = -lrt -endif - diff --git a/helgrind/tests/cond_timedwait_invalid.c b/helgrind/tests/cond_timedwait_invalid.c index a8d0448d2f..8c3bd86894 100644 --- a/helgrind/tests/cond_timedwait_invalid.c +++ b/helgrind/tests/cond_timedwait_invalid.c @@ -1,4 +1,4 @@ -#include "config.h" + #include #include #include @@ -10,12 +10,12 @@ int main() 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);