From f1c3c46914bb8b71335ee0d065b1a639f9caad89 Mon Sep 17 00:00:00 2001 From: John Levon Date: Wed, 19 Dec 2018 17:29:18 +0000 Subject: 10113 fmd_adm_xprt_f should return void Reviewed by: Andy Stormont Reviewed by: Toomas Soome Reviewed by: Gergő Doma Approved by: Richard Lowe MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- usr/src/cmd/fm/fmstat/common/fmstat.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'usr/src/cmd/fm') diff --git a/usr/src/cmd/fm/fmstat/common/fmstat.c b/usr/src/cmd/fm/fmstat/common/fmstat.c index adc14fe40b..e779fca00b 100644 --- a/usr/src/cmd/fm/fmstat/common/fmstat.c +++ b/usr/src/cmd/fm/fmstat/common/fmstat.c @@ -24,6 +24,10 @@ * Use is subject to license terms. */ +/* + * Copyright (c) 2018, Joyent, Inc. + */ + #include #include @@ -373,7 +377,7 @@ modstat_compute(struct modstats *mp, fmd_adm_stats_t *ams) } /*ARGSUSED*/ -static int +static void stat_one_xprt(id_t id, void *ignored) { fmd_adm_stats_t ams; @@ -381,7 +385,7 @@ stat_one_xprt(id_t id, void *ignored) 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) { @@ -392,7 +396,7 @@ stat_one_xprt(id_t id, void *ignored) 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); @@ -412,7 +416,6 @@ stat_one_xprt(id_t id, void *ignored) mp->m_new->module.fmds_value.str); (void) fmd_adm_stats_free(g_adm, &ams); - return (0); } static void @@ -426,7 +429,7 @@ stat_xprt(void) die("failed to retrieve list of transports"); } -static int +static void stat_one_xprt_auth(id_t id, void *arg) { const char *module = arg; @@ -435,7 +438,7 @@ stat_one_xprt_auth(id_t id, void *arg) 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) { @@ -446,7 +449,7 @@ stat_one_xprt_auth(id_t id, void *arg) 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); @@ -461,7 +464,6 @@ stat_one_xprt_auth(id_t id, void *arg) } (void) fmd_adm_stats_free(g_adm, &ams); - return (0); } static void -- cgit v1.2.3 From b1f626711b7485860ff0a6eb5e6edc949958f605 Mon Sep 17 00:00:00 2001 From: John Levon Date: Wed, 19 Dec 2018 18:32:06 +0000 Subject: 10130 smatch fixes for usr/src/cmd/fm Reviewed by: Gergő Doma Reviewed by: Andy Stormont Approved by: Richard Lowe MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- usr/src/cmd/fm/fmdump/common/fault.c | 4 ++-- usr/src/cmd/fm/notify/smtp-notify/common/smtp-notify.c | 7 ++++++- usr/src/cmd/fm/notify/snmp-notify/common/snmp-notify.c | 6 +++++- 3 files changed, 13 insertions(+), 4 deletions(-) (limited to 'usr/src/cmd/fm') diff --git a/usr/src/cmd/fm/fmdump/common/fault.c b/usr/src/cmd/fm/fmdump/common/fault.c index 68f84faf5f..6019c7f294 100644 --- a/usr/src/cmd/fm/fmdump/common/fault.c +++ b/usr/src/cmd/fm/fmdump/common/fault.c @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2017, Joyent, Inc. All rights reserved. + * Copyright (c) 2018, Joyent, Inc. */ #include @@ -183,7 +183,7 @@ flt_verb23_cmn(fmd_log_t *lp, const fmd_log_record_t *rp, FILE *fp, for (i = 0; i < rp->rec_nrefs; i++) { fmdump_printf(fp, " "); - efp->do_func(lp, &rp->rec_xrefs[i], fp); + (void) efp->do_func(lp, &rp->rec_xrefs[i], fp); } fmdump_printf(fp, "\n"); diff --git a/usr/src/cmd/fm/notify/smtp-notify/common/smtp-notify.c b/usr/src/cmd/fm/notify/smtp-notify/common/smtp-notify.c index a94baffed6..ba42e20d91 100644 --- a/usr/src/cmd/fm/notify/smtp-notify/common/smtp-notify.c +++ b/usr/src/cmd/fm/notify/smtp-notify/common/smtp-notify.c @@ -22,6 +22,11 @@ /* * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. */ + +/* + * Copyright (c) 2018, Joyent, Inc. + */ + #include #include #include @@ -811,7 +816,7 @@ main(int argc, char *argv[]) break; default: free(nhdl); - return (usage(nhdl->nh_pname)); + return (usage(argv[0])); } } } diff --git a/usr/src/cmd/fm/notify/snmp-notify/common/snmp-notify.c b/usr/src/cmd/fm/notify/snmp-notify/common/snmp-notify.c index 76ed1637a0..adb0c10032 100644 --- a/usr/src/cmd/fm/notify/snmp-notify/common/snmp-notify.c +++ b/usr/src/cmd/fm/notify/snmp-notify/common/snmp-notify.c @@ -23,6 +23,10 @@ * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. */ +/* + * Copyright (c) 2018, Joyent, Inc. + */ + #include #include #include @@ -577,7 +581,7 @@ main(int argc, char *argv[]) break; default: free(nhdl); - return (usage(nhdl->nh_pname)); + return (usage(argv[0])); } } } -- cgit v1.2.3