Print this page
10113 fmd_adm_xprt_f should return void

@@ -22,10 +22,14 @@
 /*
  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
 
+/*
+ * Copyright (c) 2018, Joyent, Inc.
+ */
+
 #include <fm/fmd_adm.h>
 
 #include <strings.h>
 #include <limits.h>
 #include <stdlib.h>

@@ -371,19 +375,19 @@
         else
                 mp->m_pct_b = 0.0;
 }
 
 /*ARGSUSED*/
-static int
+static void
 stat_one_xprt(id_t id, void *ignored)
 {
         fmd_adm_stats_t ams;
         struct modstats *mp;
 
         if (fmd_adm_xprt_stats(g_adm, id, &ams) != 0) {
                 warn("failed to retrieve statistics for transport %d", (int)id);
-                return (0); /* continue on to the next transport */
+                return;
         }
 
         for (mp = g_mods; mp != NULL; mp = mp->m_next) {
                 if (mp->m_id == id)
                         break;

@@ -390,11 +394,11 @@
         }
 
         if (mp == NULL && (mp = modstat_create(NULL, id)) == NULL) {
                 warn("failed to allocate memory for transport %d", (int)id);
                 (void) fmd_adm_stats_free(g_adm, &ams);
-                return (0);
+                return;
         }
 
         modstat_compute(mp, &ams);
 
         (void) printf("%3d %5s %7llu %7llu %7llu %7llu "

@@ -410,11 +414,10 @@
             mp->m_new->lost.fmds_value.ui64),
             mp->m_wait, mp->m_svc, mp->m_pct_w, mp->m_pct_b,
             mp->m_new->module.fmds_value.str);
 
         (void) fmd_adm_stats_free(g_adm, &ams);
-        return (0);
 }
 
 static void
 stat_xprt(void)
 {

@@ -424,20 +427,20 @@
 
         if (fmd_adm_xprt_iter(g_adm, stat_one_xprt, NULL) != 0)
                 die("failed to retrieve list of transports");
 }
 
-static int
+static void
 stat_one_xprt_auth(id_t id, void *arg)
 {
         const char *module = arg;
         fmd_adm_stats_t ams;
         struct modstats *mp;
 
         if (fmd_adm_xprt_stats(g_adm, id, &ams) != 0) {
                 warn("failed to retrieve statistics for transport %d", (int)id);
-                return (0); /* continue on to the next transport */
+                return;
         }
 
         for (mp = g_mods; mp != NULL; mp = mp->m_next) {
                 if (mp->m_id == id)
                         break;

@@ -444,11 +447,11 @@
         }
 
         if (mp == NULL && (mp = modstat_create(NULL, id)) == NULL) {
                 warn("failed to allocate memory for transport %d", (int)id);
                 (void) fmd_adm_stats_free(g_adm, &ams);
-                return (0);
+                return;
         }
 
         modstat_compute(mp, &ams);
 
         if (module == NULL ||

@@ -459,11 +462,10 @@
                     mp->m_new->authority.fmds_value.str ?
                     mp->m_new->authority.fmds_value.str : "-");
         }
 
         (void) fmd_adm_stats_free(g_adm, &ams);
-        return (0);
 }
 
 static void
 stat_xprt_auth(const char *module)
 {