From afe4c21720ed9956ba4034a64508f38d3cedc17e Mon Sep 17 00:00:00 2001 From: David Lamparter Date: Tue, 17 Jan 2017 23:07:59 +0100 Subject: [PATCH] *: remove quagga_gettime() return value checks The next patch will bulk-replace these, and monotime() has time_t as return value, not an error indicator. Signed-off-by: David Lamparter --- ospf6d/ospf6_lsa.c | 8 ++------ ospf6d/ospf6_message.c | 5 +---- zebra/zebra_fpm.c | 20 +++----------------- 3 files changed, 6 insertions(+), 27 deletions(-) diff --git a/ospf6d/ospf6_lsa.c b/ospf6d/ospf6_lsa.c index 06962ec069..92ee9662b7 100644 --- a/ospf6d/ospf6_lsa.c +++ b/ospf6d/ospf6_lsa.c @@ -207,9 +207,7 @@ ospf6_lsa_age_set (struct ospf6_lsa *lsa) assert (lsa && lsa->header); - if (quagga_gettime (QUAGGA_CLK_MONOTONIC, &now) < 0) - zlog_warn ("LSA: quagga_gettime failed, may fail LSA AGEs: %s", - safe_strerror (errno)); + quagga_gettime (QUAGGA_CLK_MONOTONIC, &now); lsa->birth.tv_sec = now.tv_sec - ntohs (lsa->header->age); lsa->birth.tv_usec = now.tv_usec; @@ -230,9 +228,7 @@ ospf6_lsa_age_current (struct ospf6_lsa *lsa) assert (lsa->header); /* current time */ - if (quagga_gettime (QUAGGA_CLK_MONOTONIC, &now) < 0) - zlog_warn ("LSA: quagga_gettime failed, may fail LSA AGEs: %s", - safe_strerror (errno)); + quagga_gettime (QUAGGA_CLK_MONOTONIC, &now); if (ntohs (lsa->header->age) >= OSPF_LSA_MAXAGE) { diff --git a/ospf6d/ospf6_message.c b/ospf6d/ospf6_message.c index e9a25d37e5..229c1ef557 100644 --- a/ospf6d/ospf6_message.c +++ b/ospf6d/ospf6_message.c @@ -1817,10 +1817,7 @@ ospf6_dbdesc_send (struct thread *thread) if (CHECK_FLAG (on->dbdesc_bits, OSPF6_DBDESC_IBIT) && (on->dbdesc_seqnum == 0)) { - struct timeval tv; - if (quagga_gettime (QUAGGA_CLK_MONOTONIC, &tv) < 0) - tv.tv_sec = 1; - on->dbdesc_seqnum = tv.tv_sec; + on->dbdesc_seqnum = quagga_monotime (); } dbdesc->options[0] = on->ospf6_if->area->options[0]; diff --git a/zebra/zebra_fpm.c b/zebra/zebra_fpm.c index 8b337152b4..d44c75383b 100644 --- a/zebra/zebra_fpm.c +++ b/zebra/zebra_fpm.c @@ -296,20 +296,6 @@ zfpm_state_to_str (zfpm_state_t state) } } -/* - * zfpm_get_time - */ -static time_t -zfpm_get_time (void) -{ - struct timeval tv; - - if (quagga_gettime (QUAGGA_CLK_MONOTONIC, &tv) < 0) - zlog_warn ("FPM: quagga_gettime failed!!"); - - return tv.tv_sec; -} - /* * zfpm_get_elapsed_time * @@ -320,7 +306,7 @@ zfpm_get_elapsed_time (time_t reference) { time_t now; - now = zfpm_get_time (); + now = quagga_monotime (); if (now < reference) { @@ -1177,7 +1163,7 @@ zfpm_connect_cb (struct thread *t) */ zfpm_g->connect_calls++; zfpm_g->stats.connect_calls++; - zfpm_g->last_connect_call_time = zfpm_get_time (); + zfpm_g->last_connect_call_time = quagga_monotime (); ret = connect (sock, (struct sockaddr *) &serv, sizeof (serv)); if (ret >= 0) @@ -1531,7 +1517,7 @@ zfpm_clear_stats (struct vty *vty) zfpm_stop_stats_timer (); zfpm_start_stats_timer (); - zfpm_g->last_stats_clear_time = zfpm_get_time(); + zfpm_g->last_stats_clear_time = quagga_monotime(); vty_out (vty, "Cleared FPM stats%s", VTY_NEWLINE); } -- 2.39.5