pimd: Simplify gettime-related code.
diff --git a/pimd/Makefile.am b/pimd/Makefile.am
index 3b8a0e1..7173a23 100644
--- a/pimd/Makefile.am
+++ b/pimd/Makefile.am
@@ -25,8 +25,6 @@
# PIM_REPORT_RECV_IFINDEX_MISMATCH: Report sock/recv ifindex mismatch
# PIM_ENFORCE_LOOPFREE_MFC: Refuse adding looping MFC entries
# PIM_UNEXPECTED_KERNEL_UPCALL: Report unexpected kernel upcall
-# PIM_USE_QUAGGA_GETTIME: Prefer quagga_gettime
-# PIM_GETTIME_USE_GETTIMEOFDAY: Work-around improper monotonic clock
PIM_DEFS =
#PIM_DEFS += -DPIM_DEBUG_BYDEFAULT
@@ -35,8 +33,6 @@
PIM_DEFS += -DPIM_ZCLIENT_DEBUG
PIM_DEFS += -DPIM_ENFORCE_LOOPFREE_MFC
#PIM_DEFS += -DPIM_UNEXPECTED_KERNEL_UPCALL
-#PIM_DEFS += -DPIM_USE_QUAGGA_GETTIME
-PIM_DEFS += -DPIM_GETTIME_USE_GETTIMEOFDAY
INCLUDES = @INCLUDES@ -I.. -I$(top_srcdir) -I$(top_srcdir)/lib
DEFS = @DEFS@ -DSYSCONFDIR=\"$(sysconfdir)/\" $(PIM_DEFS)
diff --git a/pimd/pim_main.c b/pimd/pim_main.c
index 0ae4ae9..c646356 100644
--- a/pimd/pim_main.c
+++ b/pimd/pim_main.c
@@ -272,14 +272,6 @@
zlog_notice("PIM_UNEXPECTED_KERNEL_UPCALL: report unexpected kernel upcall");
#endif
-#ifdef PIM_USE_QUAGGA_GETTIME
- zlog_notice("PIM_USE_QUAGGA_GETTIME: using Quagga's quagga_gettime"());
-#endif
-
-#ifdef PIM_GETTIME_USE_GETTIMEOFDAY
- zlog_notice("PIM_GETTIME_USE_GETTIMEOFDAY: work-around improper monotonic clock");
-#endif
-
#ifdef HAVE_CLOCK_MONOTONIC
zlog_notice("HAVE_CLOCK_MONOTONIC");
#else
diff --git a/pimd/pim_time.c b/pimd/pim_time.c
index fce30c0..097b470 100644
--- a/pimd/pim_time.c
+++ b/pimd/pim_time.c
@@ -30,63 +30,16 @@
#include "pim_time.h"
-#ifndef PIM_GETTIME_USE_GETTIMEOFDAY
-static int pim_gettime(int clk_id, struct timeval *tv)
-{
- struct timespec ts;
- int result;
-
-#ifdef PIM_USE_QUAGGA_GETTIME
- result = quagga_gettime(clk_id, tv);
- if (result) {
- zlog_err("%s: quagga_gettime(clk_id=%d) failure: errno=%d: %s",
- __PRETTY_FUNCTION__, clk_id,
- errno, safe_strerror(errno));
- }
-#else
- result = clock_gettime(clk_id, &ts);
- if (result) {
- zlog_err("%s: clock_gettime(clk_id=%d) failure: errno=%d: %s",
- __PRETTY_FUNCTION__, clk_id,
- errno, safe_strerror(errno));
- return result;
- }
- if (tv) {
- tv->tv_sec = ts.tv_sec;
- tv->tv_usec = 1000 * ts.tv_nsec;
- }
-#endif
-
- return result;
-}
-#endif
-
static int gettime_monotonic(struct timeval *tv)
{
int result;
-#ifdef PIM_GETTIME_USE_GETTIMEOFDAY
result = gettimeofday(tv, 0);
if (result) {
zlog_err("%s: gettimeofday() failure: errno=%d: %s",
__PRETTY_FUNCTION__,
errno, safe_strerror(errno));
}
-#elif defined(PIM_USE_QUAGGA_GETTIME)
- result = pim_gettime(QUAGGA_CLK_MONOTONIC, tv);
- if (result) {
- zlog_err("%s: pim_gettime(QUAGGA_CLK_MONOTONIC=%d) failure: errno=%d: %s",
- __PRETTY_FUNCTION__, QUAGGA_CLK_MONOTONIC,
- errno, safe_strerror(errno));
- }
-#else
- result = pim_gettime(CLOCK_MONOTONIC, tv);
- if (result) {
- zlog_err("%s: pim_gettime(CLOCK_MONOTONIC=%d) failure: errno=%d: %s",
- __PRETTY_FUNCTION__, CLOCK_MONOTONIC,
- errno, safe_strerror(errno));
- }
-#endif
return result;
}