diff options
Diffstat (limited to 'usr/src/cmd')
| -rw-r--r-- | usr/src/cmd/dladm/dladm.c | 9 | ||||
| -rw-r--r-- | usr/src/cmd/dlstat/dlstat.c | 26 | ||||
| -rw-r--r-- | usr/src/cmd/flowstat/flowstat.c | 16 | ||||
| -rw-r--r-- | usr/src/cmd/iscsiadm/cmdparse.c | 10 | ||||
| -rw-r--r-- | usr/src/cmd/isns/isnsadm/cmdparse.c | 9 | ||||
| -rw-r--r-- | usr/src/cmd/mpathadm/cmdparse.c | 10 | ||||
| -rw-r--r-- | usr/src/cmd/zpool/zpool_main.c | 3 |
7 files changed, 52 insertions, 31 deletions
diff --git a/usr/src/cmd/dladm/dladm.c b/usr/src/cmd/dladm/dladm.c index 92f3bfb665..a69b3da081 100644 --- a/usr/src/cmd/dladm/dladm.c +++ b/usr/src/cmd/dladm/dladm.c @@ -23,6 +23,7 @@ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2017 Joyent, Inc. * Copyright 2016 Nexenta Systems, Inc. + * Copyright 2020 Peter Tribble. */ #include <stdio.h> @@ -1148,7 +1149,7 @@ typedef struct usage_fields_buf_s { char usage_rbytes[10]; char usage_opackets[9]; char usage_obytes[10]; - char usage_bandwidth[14]; + char usage_bandwidth[15]; } usage_fields_buf_t; static const ofmt_field_t usage_fields[] = { @@ -1164,7 +1165,7 @@ static const ofmt_field_t usage_fields[] = { offsetof(usage_fields_buf_t, usage_opackets), print_default_cb}, { "OBYTES", 11, offsetof(usage_fields_buf_t, usage_obytes), print_default_cb}, -{ "BANDWIDTH", 15, +{ "BANDWIDTH", 16, offsetof(usage_fields_buf_t, usage_bandwidth), print_default_cb}, { NULL, 0, 0, NULL}} ; @@ -1180,7 +1181,7 @@ typedef struct usage_l_fields_buf_s { char usage_l_etime[13]; char usage_l_rbytes[8]; char usage_l_obytes[8]; - char usage_l_bandwidth[14]; + char usage_l_bandwidth[15]; } usage_l_fields_buf_t; static const ofmt_field_t usage_l_fields[] = { @@ -1195,7 +1196,7 @@ static const ofmt_field_t usage_l_fields[] = { offsetof(usage_l_fields_buf_t, usage_l_rbytes), print_default_cb}, { "OBYTES", 9, offsetof(usage_l_fields_buf_t, usage_l_obytes), print_default_cb}, -{ "BANDWIDTH", 15, +{ "BANDWIDTH", 16, offsetof(usage_l_fields_buf_t, usage_l_bandwidth), print_default_cb}, { NULL, 0, 0, NULL}} ; diff --git a/usr/src/cmd/dlstat/dlstat.c b/usr/src/cmd/dlstat/dlstat.c index 8c1749475b..d11e623206 100644 --- a/usr/src/cmd/dlstat/dlstat.c +++ b/usr/src/cmd/dlstat/dlstat.c @@ -27,6 +27,10 @@ * Copyright 2017 Joyent, Inc. */ +/* + * Copyright 2020 Peter Tribble. + */ + #include <stdio.h> #include <ctype.h> #include <locale.h> @@ -417,7 +421,7 @@ typedef struct history_fields_buf_s { char h_rbytes[10]; char h_opackets[9]; char h_obytes[10]; - char h_bandwidth[14]; + char h_bandwidth[15]; } history_fields_buf_t; static ofmt_field_t history_fields[] = { @@ -433,7 +437,7 @@ static ofmt_field_t history_fields[] = { offsetof(history_fields_buf_t, h_opackets), print_default_cb}, { "OBYTES", 11, offsetof(history_fields_buf_t, h_obytes), print_default_cb}, -{ "BANDWIDTH", 15, +{ "BANDWIDTH", 16, offsetof(history_fields_buf_t, h_bandwidth), print_default_cb}, { NULL, 0, 0, NULL}}; @@ -446,7 +450,7 @@ typedef struct history_l_fields_buf_s { char hl_etime[13]; char hl_rbytes[8]; char hl_obytes[8]; - char hl_bandwidth[14]; + char hl_bandwidth[15]; } history_l_fields_buf_t; static ofmt_field_t history_l_fields[] = { @@ -461,7 +465,7 @@ static ofmt_field_t history_l_fields[] = { offsetof(history_l_fields_buf_t, hl_rbytes), print_default_cb}, { "OBYTES", 9, offsetof(history_l_fields_buf_t, hl_obytes), print_default_cb}, -{ "BANDWIDTH", 15, +{ "BANDWIDTH", 16, offsetof(history_l_fields_buf_t, hl_bandwidth), print_default_cb}, { NULL, 0, 0, NULL}} ; @@ -569,7 +573,7 @@ show_history_time(dladm_usage_t *history, void *arg) { show_history_state_t *state = arg; char buf[DLADM_STRSIZE]; - history_l_fields_buf_t ubuf; + history_l_fields_buf_t ubuf; time_t time; double bw; dladm_status_t status; @@ -754,7 +758,7 @@ do_show_history(int argc, char *argv[], const char *use) die("show-link -h requires a file"); if (optind == (argc-1)) { - uint32_t flags; + uint32_t flags; resource = argv[optind]; if (!state.hs_showall && @@ -1500,7 +1504,7 @@ static int show_queried_stats(dladm_handle_t dh, datalink_id_t linkid, void *arg) { show_state_t *state = arg; - int i; + int i; dladm_stat_chain_t *diff_stat; char linkname[DLPI_LINKNAME_MAX]; char zonename[DLADM_PROP_VAL_MAX + 1]; @@ -1654,7 +1658,7 @@ do_show(int argc, char *argv[], const char *use) ofmt_handle_t ofmt; ofmt_status_t oferr; uint_t ofmtflags = OFMT_RIGHTJUST; - ofmt_field_t *oftemplate; + ofmt_field_t *oftemplate; bzero(&state, sizeof (state)); opterr = 0; @@ -1855,7 +1859,7 @@ do_show_phys(int argc, char *argv[], const char *use) ofmt_handle_t ofmt; ofmt_status_t oferr; uint_t ofmtflags = OFMT_RIGHTJUST; - ofmt_field_t *oftemplate; + ofmt_field_t *oftemplate; bzero(&state, sizeof (state)); opterr = 0; @@ -2037,7 +2041,7 @@ do_show_link(int argc, char *argv[], const char *use) ofmt_handle_t ofmt; ofmt_status_t oferr; uint_t ofmtflags = OFMT_RIGHTJUST; - ofmt_field_t *oftemplate; + ofmt_field_t *oftemplate; bzero(&state, sizeof (state)); opterr = 0; @@ -2242,7 +2246,7 @@ do_show_aggr(int argc, char *argv[], const char *use) ofmt_handle_t ofmt; ofmt_status_t oferr; uint_t ofmtflags = OFMT_RIGHTJUST; - ofmt_field_t *oftemplate; + ofmt_field_t *oftemplate; bzero(&state, sizeof (state)); opterr = 0; diff --git a/usr/src/cmd/flowstat/flowstat.c b/usr/src/cmd/flowstat/flowstat.c index e772470f9d..a0e2b85f32 100644 --- a/usr/src/cmd/flowstat/flowstat.c +++ b/usr/src/cmd/flowstat/flowstat.c @@ -31,6 +31,10 @@ * Copyright 2019 OmniOS Community Edition (OmniOSce) Association. */ +/* + * Copyright 2020 Peter Tribble. + */ + #include <stdio.h> #include <locale.h> #include <stdarg.h> @@ -139,7 +143,7 @@ typedef struct history_fields_buf_s { char history_rbytes[10]; char history_opackets[9]; char history_obytes[10]; - char history_bandwidth[14]; + char history_bandwidth[15]; } history_fields_buf_t; static ofmt_field_t history_fields[] = { @@ -156,7 +160,7 @@ static ofmt_field_t history_fields[] = { offsetof(history_fields_buf_t, history_opackets), print_default_cb}, { "OBYTES", 11, offsetof(history_fields_buf_t, history_obytes), print_default_cb}, -{ "BANDWIDTH", 15, +{ "BANDWIDTH", 16, offsetof(history_fields_buf_t, history_bandwidth), print_default_cb}, NULL_OFMT} ; @@ -167,7 +171,7 @@ typedef struct history_l_fields_buf_s { char history_l_etime[13]; char history_l_rbytes[8]; char history_l_obytes[8]; - char history_l_bandwidth[14]; + char history_l_bandwidth[15]; } history_l_fields_buf_t; static ofmt_field_t history_l_fields[] = { @@ -182,7 +186,7 @@ static ofmt_field_t history_l_fields[] = { offsetof(history_l_fields_buf_t, history_l_rbytes), print_default_cb}, { "OBYTES", 9, offsetof(history_l_fields_buf_t, history_l_obytes), print_default_cb}, -{ "BANDWIDTH", 15, +{ "BANDWIDTH", 16, offsetof(history_l_fields_buf_t, history_l_bandwidth), print_default_cb}, NULL_OFMT} @@ -544,7 +548,7 @@ dump_all_flow_stats(dladm_flow_attr_t *attrp, void *arg, datalink_id_t linkid, int main(int argc, char *argv[]) { - dladm_status_t status; + dladm_status_t status; int option; boolean_t r_arg = B_FALSE; boolean_t t_arg = B_FALSE; @@ -790,7 +794,7 @@ show_history_time(dladm_usage_t *history, void *arg) { show_history_state_t *state = (show_history_state_t *)arg; char buf[DLADM_STRSIZE]; - history_l_fields_buf_t ubuf; + history_l_fields_buf_t ubuf; time_t time; double bw; dladm_flow_attr_t attr; diff --git a/usr/src/cmd/iscsiadm/cmdparse.c b/usr/src/cmd/iscsiadm/cmdparse.c index 882ff3c673..b1a2f84692 100644 --- a/usr/src/cmd/iscsiadm/cmdparse.c +++ b/usr/src/cmd/iscsiadm/cmdparse.c @@ -23,6 +23,10 @@ * Use is subject to license terms. */ +/* + * Copyright 2020 Joyent Inc. + */ + #include <stdlib.h> #include <stdio.h> #include <sys/types.h> @@ -70,7 +74,7 @@ static void subUsage(uint_t, subcommand_t *); static void subUsageObject(uint_t, subcommand_t *, object_t *); static int getObject(char *, object_t **); static int getObjectRules(uint_t, objectRules_t **); -static char *getLongOption(int); +static const char *getLongOption(int); static optionProp_t *getOptions(uint_t, uint_t); static char *getOptionArgDesc(int); extern void seeMan(void); @@ -208,7 +212,7 @@ getOptions(uint_t object, uint_t subcommand) * on success, long option name * on failure, NULL */ -static char * +static const char * getLongOption(int shortOption) { struct option *op; @@ -319,7 +323,7 @@ subUsageObject(uint_t usageType, subcommand_t *subcommand, object_t *objp) opCmd_t *opCmd = NULL; optionProp_t *options; char *optionArgDesc; - char *longOpt; + const char *longOpt; if (getObjectRules(objp->value, &objRules) != 0) { diff --git a/usr/src/cmd/isns/isnsadm/cmdparse.c b/usr/src/cmd/isns/isnsadm/cmdparse.c index ccad6df26c..7303b347ac 100644 --- a/usr/src/cmd/isns/isnsadm/cmdparse.c +++ b/usr/src/cmd/isns/isnsadm/cmdparse.c @@ -22,6 +22,9 @@ * Copyright 2008 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ +/* + * Copyright 2020 Joyent Inc. + */ #include <stdlib.h> #include <stdio.h> @@ -69,7 +72,7 @@ static int getSubcommandProps(char *, subCommandProps_t **); static char *getExecBasename(char *); static void usage(uint_t); static void subUsage(uint_t, subCommandProps_t *); -static char *getLongOption(int); +static const char *getLongOption(int); static char *getOptionArgDesc(int); /* global data */ @@ -119,7 +122,7 @@ getSubcommandProps(char *subCommand, subCommandProps_t **subCommandProps) * on success, long option name * on failure, NULL */ -static char * +static const char * getLongOption(int shortOption) { struct option *op; @@ -169,7 +172,7 @@ subUsage(uint_t usageType, subCommandProps_t *subcommand) { int i; char *optionArgDesc; - char *longOpt; + const char *longOpt; if (usageType == GENERAL_USAGE) { (void) printf("%s:\t%s %s [", gettext("Usage"), commandName, diff --git a/usr/src/cmd/mpathadm/cmdparse.c b/usr/src/cmd/mpathadm/cmdparse.c index 9080e1cfdd..c4c2dd744a 100644 --- a/usr/src/cmd/mpathadm/cmdparse.c +++ b/usr/src/cmd/mpathadm/cmdparse.c @@ -22,6 +22,10 @@ * Copyright 2008 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ +/* + * Copyright 2020 Joyent Inc. + */ + #include <stdlib.h> #include <stdio.h> @@ -70,7 +74,7 @@ static void subUsage(uint_t, subcommand_t *); static void subUsageObject(uint_t, subcommand_t *, object_t *); static int getObject(char *, object_t **); static int getObjectRules(uint_t, objectRules_t **); -static char *getLongOption(int); +static const char *getLongOption(int); static optionProp_t *getOptions(uint_t, uint_t); static char *getOptionArgDesc(int); @@ -207,7 +211,7 @@ getOptions(uint_t object, uint_t subcommand) * on success, long option name * on failure, NULL */ -static char * +static const char * getLongOption(int shortOption) { struct option *op; @@ -317,7 +321,7 @@ subUsageObject(uint_t usageType, subcommand_t *subcommand, object_t *objp) opCmd_t *opCmd = NULL; optionProp_t *options; char *optionArgDesc; - char *longOpt; + const char *longOpt; if (getObjectRules(objp->value, &objRules) != 0) { diff --git a/usr/src/cmd/zpool/zpool_main.c b/usr/src/cmd/zpool/zpool_main.c index 7242a156c7..31ce0c7e11 100644 --- a/usr/src/cmd/zpool/zpool_main.c +++ b/usr/src/cmd/zpool/zpool_main.c @@ -350,7 +350,7 @@ get_usage(zpool_help_t idx) case HELP_IOSTAT: return (gettext("\tiostat " "[[-lq]|[-rw]] [-T d | u] [-ghHLpPvy]\n" - "\t [pool] ..." + "\t [[pool] ...]|[pool vdev ...]|[vdev ...]]" " [[-n] interval [count]]\n")); case HELP_LABELCLEAR: return (gettext("\tlabelclear [-f] <vdev>\n")); @@ -4987,6 +4987,7 @@ zpool_do_iostat(int argc, char **argv) cb.cb_vdev_names_count)) && !cb.cb_scripted) { print_iostat_separator(&cb); + printf("\n"); } } |
