]> git.puffer.fish Git - mirror/frr.git/commitdiff
lib: time: remove recent_time
authorDavid Lamparter <equinox@opensourcerouting.org>
Tue, 17 Jan 2017 21:48:33 +0000 (22:48 +0100)
committerDavid Lamparter <equinox@opensourcerouting.org>
Mon, 23 Jan 2017 17:26:32 +0000 (18:26 +0100)
This isn't even used anywhere.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
lib/log.c
lib/thread.c

index d48534dc181ff75493ac69b4be3e2e50bef5fa95..4ab83386539ab48d0f2d7b5f43c4cd524cff1854 100644 (file)
--- 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 */
index 711dd3b730b5d3b20f101c2a3e46cd0180832289..518a69918d526e0dc199885853fdcd696f025153 100644 (file)
@@ -41,8 +41,6 @@ DEFINE_MTYPE_STATIC(LIB, THREAD_STATS,  "Thread stats")
 #include <mach/mach_time.h>
 #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;