From 4778d35c34031f7724379ac2d3b554af4adc48dc Mon Sep 17 00:00:00 2001 From: Björn Jacke Date: Sun, 5 Jun 2011 21:30:16 +0200 Subject: s3/pthreadpool: replace bad portable gettimeofday by clock_gettime Signed-off-by: Stefan Metzmacher --- source3/lib/pthreadpool/pthreadpool.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'source3/lib') diff --git a/source3/lib/pthreadpool/pthreadpool.c b/source3/lib/pthreadpool/pthreadpool.c index 7538fb7995..9981ed25ae 100644 --- a/source3/lib/pthreadpool/pthreadpool.c +++ b/source3/lib/pthreadpool/pthreadpool.c @@ -427,7 +427,6 @@ static void *pthreadpool_server(void *arg) } while (1) { - struct timeval tv; struct timespec ts; struct pthreadpool_job *job; @@ -436,9 +435,8 @@ static void *pthreadpool_server(void *arg) * time, exit this thread. */ - gettimeofday(&tv, NULL); - ts.tv_sec = tv.tv_sec + 1; - ts.tv_nsec = tv.tv_usec*1000; + clock_gettime(CLOCK_REALTIME, &ts); + ts.tv_sec += 1; while ((pool->jobs == NULL) && (pool->shutdown == 0)) { -- cgit