Print this page
10113 fmd_adm_xprt_f should return void

*** 22,31 **** --- 22,35 ---- /* * 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,389 **** else mp->m_pct_b = 0.0; } /*ARGSUSED*/ ! static int 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 */ } for (mp = g_mods; mp != NULL; mp = mp->m_next) { if (mp->m_id == id) break; --- 375,393 ---- else mp->m_pct_b = 0.0; } /*ARGSUSED*/ ! 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; } for (mp = g_mods; mp != NULL; mp = mp->m_next) { if (mp->m_id == id) break;
*** 390,400 **** } 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); } modstat_compute(mp, &ams); (void) printf("%3d %5s %7llu %7llu %7llu %7llu " --- 394,404 ---- } 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; } modstat_compute(mp, &ams); (void) printf("%3d %5s %7llu %7llu %7llu %7llu "
*** 410,420 **** 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) { --- 414,423 ----
*** 424,443 **** if (fmd_adm_xprt_iter(g_adm, stat_one_xprt, NULL) != 0) die("failed to retrieve list of transports"); } ! static int 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 */ } for (mp = g_mods; mp != NULL; mp = mp->m_next) { if (mp->m_id == id) break; --- 427,446 ---- if (fmd_adm_xprt_iter(g_adm, stat_one_xprt, NULL) != 0) die("failed to retrieve list of transports"); } ! 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; } for (mp = g_mods; mp != NULL; mp = mp->m_next) { if (mp->m_id == id) break;
*** 444,454 **** } 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); } modstat_compute(mp, &ams); if (module == NULL || --- 447,457 ---- } 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; } modstat_compute(mp, &ams); if (module == NULL ||
*** 459,469 **** 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) { --- 462,471 ----