From 3dad49ca9499dcb917691e10ebc1685dda74cf72 Mon Sep 17 00:00:00 2001 From: David Lamparter Date: Tue, 17 Jan 2017 22:48:33 +0100 Subject: [PATCH] lib: time: remove recent_time This isn't even used anywhere. Signed-off-by: David Lamparter --- lib/log.c | 1 - lib/thread.c | 28 ---------------------------- 2 files changed, 29 deletions(-) diff --git a/lib/log.c b/lib/log.c index d48534dc18..4ab8338653 100644 --- a/lib/log.c +++ b/lib/log.c @@ -118,7 +118,6 @@ quagga_timestamp(int timestamp_precision, char *buf, size_t buflen) } cache; struct timeval clock; - /* would it be sufficient to use global 'recent_time' here? I fear not... */ gettimeofday(&clock, NULL); /* first, we update the cache if the time has changed */ diff --git a/lib/thread.c b/lib/thread.c index 711dd3b730..518a69918d 100644 --- a/lib/thread.c +++ b/lib/thread.c @@ -41,8 +41,6 @@ DEFINE_MTYPE_STATIC(LIB, THREAD_STATS, "Thread stats") #include #endif -/* Recent absolute time of day */ -struct timeval recent_time; /* Relative time, since startup */ static struct timeval relative_time; @@ -97,24 +95,6 @@ timeval_elapsed (struct timeval a, struct timeval b) + (a.tv_usec - b.tv_usec)); } -/* gettimeofday wrapper, to keep recent_time updated */ -static int -quagga_gettimeofday (struct timeval *tv) -{ - int ret; - - assert (tv); - - if (!(ret = gettimeofday (&recent_time, NULL))) - { - /* avoid copy if user passed recent_time pointer.. */ - if (tv != &recent_time) - *tv = recent_time; - return 0; - } - return ret; -} - static int quagga_get_relative (struct timeval *tv) { @@ -1418,14 +1398,6 @@ thread_getrusage (RUSAGE_T *r) quagga_get_relative (NULL); getrusage(RUSAGE_SELF, &(r->cpu)); r->real = relative_time; - -#ifdef HAVE_CLOCK_MONOTONIC - /* quagga_get_relative() only updates recent_time if gettimeofday - * based, not when using CLOCK_MONOTONIC. As we export recent_time - * and guarantee to update it before threads are run... - */ - quagga_gettimeofday(&recent_time); -#endif /* HAVE_CLOCK_MONOTONIC */ } struct thread *thread_current = NULL; -- 2.39.5