]> git.puffer.fish Git - matthieu/frr.git/commitdiff
*: remove quagga_gettime() return value checks
authorDavid Lamparter <equinox@opensourcerouting.org>
Tue, 17 Jan 2017 22:07:59 +0000 (23:07 +0100)
committerDavid Lamparter <equinox@opensourcerouting.org>
Mon, 23 Jan 2017 17:26:32 +0000 (18:26 +0100)
The next patch will bulk-replace these, and monotime() has time_t as
return value, not an error indicator.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
ospf6d/ospf6_lsa.c
ospf6d/ospf6_message.c
zebra/zebra_fpm.c

index 06962ec06902056f651592a3cd64bf1c0ae4e90b..92ee9662b72f15eb2cc21c9e91809838e2417300 100644 (file)
@@ -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)
     {
index e9a25d37e5ccd1b58e2cd67a8f148264dd5d33a3..229c1ef557cdaf75538794bf391e7601671360ae 100644 (file)
@@ -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];
index 8b337152b4936266496d2b429671aba079195b69..d44c75383b126862c8e801005ee5075a0e249ce1 100644 (file)
@@ -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);
 }