diff options
author | John Levon <john.levon@joyent.com> | 2018-12-19 18:10:14 +0000 |
---|---|---|
committer | John Levon <john.levon@joyent.com> | 2019-03-08 15:59:03 +0000 |
commit | bc54f855e0de1e590115101c80f152a20722cfb0 (patch) | |
tree | 27cff7229dcd40fe061477176fc30ca00a6656f7 /usr | |
parent | 8f5edf1f887948e6be5982cbe7f196909927af91 (diff) | |
download | illumos-gate-bc54f855e0de1e590115101c80f152a20722cfb0.tar.gz |
10120 smatch indenting fixes for usr/src/cmd
Reviewed by: Gergő Doma <domag02@gmail.com>
Reviewed by: Jason King <jason.brian.king@gmail.com>
Portions contributed by: Joyce McIntosh <joyce.mcintosh@nexenta.com>
Approved by: Richard Lowe <richlowe@richlowe.net>
Diffstat (limited to 'usr')
27 files changed, 273 insertions, 155 deletions
diff --git a/usr/src/cmd/auditconfig/auditconfig.c b/usr/src/cmd/auditconfig/auditconfig.c index 197ab63ad3..7fdaf7c59c 100644 --- a/usr/src/cmd/auditconfig/auditconfig.c +++ b/usr/src/cmd/auditconfig/auditconfig.c @@ -23,6 +23,10 @@ */ /* + * Copyright (c) 2019, Joyent, Inc. + */ + +/* * auditconfig - set and display audit parameters */ @@ -2572,14 +2576,15 @@ strisnum(char *s) if (s == NULL || !*s) return (0); - for (; *s == '-' || *s == '+'; s++) - - if (!*s) - return (0); + for (; *s == '-' || *s == '+'; s++) { + if (!*s) + return (0); + } - for (; *s; s++) + for (; *s; s++) { if (!isdigit(*s)) return (0); + } return (1); } diff --git a/usr/src/cmd/busstat/busstat.c b/usr/src/cmd/busstat/busstat.c index 23ef251223..94cfdb021b 100644 --- a/usr/src/cmd/busstat/busstat.c +++ b/usr/src/cmd/busstat/busstat.c @@ -24,7 +24,9 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" +/* + * Copyright (c) 2018, Joyent, Inc. + */ #include <stdio.h> #include <stdlib.h> @@ -398,7 +400,7 @@ parse_cmd(int mode) "event names or pic values not " "permitted with -r option.\n"), pgmname); - usage(); + usage(); exit(1); } /* diff --git a/usr/src/cmd/cat/cat.c b/usr/src/cmd/cat/cat.c index 9a40c4dd37..b447581710 100644 --- a/usr/src/cmd/cat/cat.c +++ b/usr/src/cmd/cat/cat.c @@ -27,6 +27,9 @@ * Use is subject to license terms. */ +/* + * Copyright (c) 2018, Joyent, Inc. + */ /* * Concatenate files. @@ -271,10 +274,12 @@ main(int argc, char **argv) !S_ISBLK(target.st_mode) && !S_ISSOCK(target.st_mode) && IDENTICAL(target, source)) { - if (!silent) - (void) fprintf(stderr, - gettext("cat: input/output files '%s' identical\n"), - stdinflg?"-": *argv); + if (!silent) { + (void) fprintf(stderr, gettext("cat: " + "input/output files '%s' identical\n"), + stdinflg?"-": *argv); + } + if (fclose(fi) != 0) (void) fprintf(stderr, gettext("cat: close error: %s\n"), diff --git a/usr/src/cmd/chown/chown.c b/usr/src/cmd/chown/chown.c index 15db448a5b..4542ab25bf 100644 --- a/usr/src/cmd/chown/chown.c +++ b/usr/src/cmd/chown/chown.c @@ -32,6 +32,10 @@ */ /* + * Copyright (c) 2018, Joyent, Inc. + */ + +/* * chown [-fhR] uid[:gid] file ... * chown -R [-f] [-H|-L|-P] uid[:gid] file ... * chown -s [-fhR] ownersid[:groupsid] file ... @@ -199,7 +203,7 @@ main(int argc, char *argv[]) if (errno == ERANGE) { (void) fprintf(stderr, gettext( "chown: group id too large\n")); - exit(2); + exit(2); } else { (void) fprintf(stderr, gettext( "chown: invalid group id\n")); diff --git a/usr/src/cmd/cmd-inet/common/kcmd.c b/usr/src/cmd/cmd-inet/common/kcmd.c index 35d2c4ee96..c4a078c96a 100644 --- a/usr/src/cmd/cmd-inet/common/kcmd.c +++ b/usr/src/cmd/cmd-inet/common/kcmd.c @@ -20,6 +20,10 @@ * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ +/* + * Copyright (c) 2018, Joyent, Inc. + */ + /* derived from @(#)rcmd.c 5.17 (Berkeley) 6/27/88 */ #include <unistd.h> @@ -412,8 +416,11 @@ kcmd(int *sock, char **ahost, ushort_t rport, *sock = s; /* pass back credentials if wanted */ - if (cred) (void) krb5_copy_creds(bsd_context, ret_cred, cred); - krb5_free_creds(bsd_context, ret_cred); + if (cred) + (void) krb5_copy_creds(bsd_context, ret_cred, cred); + + krb5_free_creds(bsd_context, ret_cred); + /* * Initialize *authconp to auth_context, so * that the clients can make use of it diff --git a/usr/src/cmd/cmd-inet/usr.bin/finger.c b/usr/src/cmd/cmd-inet/usr.bin/finger.c index cdc94a7be6..d42d90eacf 100644 --- a/usr/src/cmd/cmd-inet/usr.bin/finger.c +++ b/usr/src/cmd/cmd-inet/usr.bin/finger.c @@ -38,6 +38,10 @@ */ /* + * Copyright (c) 2018, Joyent, Inc. + */ + +/* * This is a finger program. It prints out useful information about users * by digging it up from various system files. * @@ -1359,7 +1363,7 @@ AlreadyPrinted(uid_t uid) while (i++ < PPIndex) { if (PlanPrinted[i] == uid) - return (1); + return (1); } if (i < PPMAX) { PlanPrinted[i] = uid; diff --git a/usr/src/cmd/compress/compress.c b/usr/src/cmd/compress/compress.c index de8e62b704..f0fb948239 100644 --- a/usr/src/cmd/compress/compress.c +++ b/usr/src/cmd/compress/compress.c @@ -13,7 +13,9 @@ * specifies the terms and conditions for redistribution. */ -#pragma ident "%Z%%M% %I% %E% SMI" +/* + * Copyright (c) 2018, Joyent, Inc. + */ /* * Compress - data compression program @@ -815,7 +817,7 @@ main(int argc, char *argv[]) } else if (!quiet && !do_decomp) { (void) fprintf(stderr, "%s: ", *fileptr); - newline_needed = 1; + newline_needed = 1; } /* Actually do the compression/decompression */ @@ -1308,7 +1310,7 @@ decompress() if ((code == CLEAR) && block_compress) { for (code = 255; code >= 0; code--) - tab_prefixof(code) = 0; + tab_prefixof(code) = 0; clear_flg = 1; free_ent = FIRST - 1; if ((code = getcode()) == -1) /* O, untimely death! */ @@ -1803,8 +1805,9 @@ cl_hash(count_int hsize) /* reset code table */ *(htab_p-1) = m1; htab_p -= 16; } while ((i -= 16) >= 0); - for (i += 16; i > 0; i--) - *--htab_p = m1; + + for (i += 16; i > 0; i--) + *--htab_p = m1; } static void diff --git a/usr/src/cmd/dfs.cmds/sharemgr/commands.c b/usr/src/cmd/dfs.cmds/sharemgr/commands.c index 15e9cee992..f8cbecf01a 100644 --- a/usr/src/cmd/dfs.cmds/sharemgr/commands.c +++ b/usr/src/cmd/dfs.cmds/sharemgr/commands.c @@ -5656,46 +5656,46 @@ sa_legacy_share(sa_handle_t handle, int flags, int argc, char *argv[]) if (rsrc != NULL) { if (share != sa_get_resource_parent(rsrc)) ret = SA_DUPLICATE_NAME; - } else { - rsrc = sa_add_resource(share, resource, - persist, &ret); - } - if (features & SA_FEATURE_RESOURCE) - share = rsrc; + } else { + rsrc = sa_add_resource(share, resource, + persist, &ret); } + if (features & SA_FEATURE_RESOURCE) + share = rsrc; + } - /* Have a group to hold this share path */ - if (ret == SA_OK && options != NULL && - strlen(options) > 0) { - ret = sa_parse_legacy_options(share, - options, + /* Have a group to hold this share path */ + if (ret == SA_OK && options != NULL && + strlen(options) > 0) { + ret = sa_parse_legacy_options(share, + options, + protocol); + } + if (!zfs) { + /* + * ZFS shares never have a description + * and we can't store the values so + * don't try. + */ + if (ret == SA_OK && description != NULL) + ret = sa_set_share_description(share, + description); + } + if (ret == SA_OK && + strcmp(groupstatus, "enabled") == 0) { + if (rsrc != share) + ret = sa_enable_share(share, protocol); + else + ret = sa_enable_resource(rsrc, protocol); - } - if (!zfs) { - /* - * ZFS shares never have a description - * and we can't store the values so - * don't try. - */ - if (ret == SA_OK && description != NULL) - ret = sa_set_share_description(share, - description); - } if (ret == SA_OK && - strcmp(groupstatus, "enabled") == 0) { - if (rsrc != share) - ret = sa_enable_share(share, protocol); - else - ret = sa_enable_resource(rsrc, - protocol); - if (ret == SA_OK && - persist == SA_SHARE_PERMANENT) { - (void) sa_update_legacy(share, - protocol); - } - if (ret == SA_OK) - ret = sa_update_config(handle); + persist == SA_SHARE_PERMANENT) { + (void) sa_update_legacy(share, + protocol); } + if (ret == SA_OK) + ret = sa_update_config(handle); + } } err: if (ret != SA_OK) { diff --git a/usr/src/cmd/echo/echo.c b/usr/src/cmd/echo/echo.c index ebd8e3868b..e9f9027203 100644 --- a/usr/src/cmd/echo/echo.c +++ b/usr/src/cmd/echo/echo.c @@ -25,6 +25,9 @@ /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ /* All Rights Reserved */ +/* + * Copyright (c) 2018, Joyent, Inc. + */ #include <stdio.h> #include <stdlib.h> @@ -55,16 +58,16 @@ main(int argc, char *argv[]) for (i = 1; i <= argc; i++) { for (cp = argv[i], ep = cp + (int)strlen(cp); cp < ep; cp += b_len) { - if ((b_len = mbtowc(&wc, cp, MB_CUR_MAX)) <= 0) { - (void) putchar(*cp); - b_len = 1; - continue; - } + if ((b_len = mbtowc(&wc, cp, MB_CUR_MAX)) <= 0) { + (void) putchar(*cp); + b_len = 1; + continue; + } - if (wc != '\\') { - (void) putwchar(wc); - continue; - } + if (wc != '\\') { + (void) putwchar(wc); + continue; + } cp += b_len; b_len = 1; diff --git a/usr/src/cmd/fmthard/fmthard.c b/usr/src/cmd/fmthard/fmthard.c index 98faee8db3..02577c1445 100644 --- a/usr/src/cmd/fmthard/fmthard.c +++ b/usr/src/cmd/fmthard/fmthard.c @@ -34,6 +34,9 @@ */ /* + * Copyright (c) 2018, Joyent, Inc. + */ +/* * Sun Microsystems version of fmthard: * * Supports the following arguments: @@ -740,7 +743,7 @@ full size of disk. The full disk capacity is %llu sectors.\n", i, fullsz); (vtoc->v_part[i].p_size % nblks)) { (void) fprintf(stderr, "\ fmthard: Partition %d not aligned on cylinder boundary \n", i); - exit(1); + exit(1); } if (vtoc->v_part[i].p_start > fullsz || vtoc->v_part[i].p_start + diff --git a/usr/src/cmd/fruadm/fruadm.c b/usr/src/cmd/fruadm/fruadm.c index 0efb6c5539..94eb9c16b3 100644 --- a/usr/src/cmd/fruadm/fruadm.c +++ b/usr/src/cmd/fruadm/fruadm.c @@ -24,6 +24,8 @@ * * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. + * + * Copyright (c) 2018, Joyent, Inc. */ #include <limits.h> @@ -243,9 +245,9 @@ display_data(unsigned char *data, size_t length, fru_elemdef_t *def) char *disp_str = (char *)alloca(length+1); for (i = 0; i < length; i++) disp_str[i] = data[i]; - disp_str[i] = '\0'; - (void) printf("%s", disp_str); - return; + disp_str[i] = '\0'; + (void) printf("%s", disp_str); + return; } case FDTYPE_Enumeration: @@ -592,7 +594,7 @@ updateiter_record(fru_nodehdl_t nodehdl, int cnt, char **ptr, (void) fprintf(stderr, gettext("fru_update_field(): %s\n"), fru_strerror(err)); - return (1); + return (1); } iter_cnt = 1; diff --git a/usr/src/cmd/getconf/getconf.c b/usr/src/cmd/getconf/getconf.c index fe2dceb76b..862c9a49c3 100644 --- a/usr/src/cmd/getconf/getconf.c +++ b/usr/src/cmd/getconf/getconf.c @@ -30,6 +30,10 @@ */ /* + * Copyright (c) 2018, Joyent, Inc. + */ + +/* * getconf -- POSIX.2 compatible utility to query configuration specific * parameters. * -- XPG4 support added June/93 @@ -936,8 +940,9 @@ main(int argc, char **argv) * sort the table by the "name" field * so we print it in sorted order */ - qsort(&sctab[0], (sizeof (sctab)/sizeof (struct sctab))-1, - sizeof (struct sctab), namecmp); + qsort(&sctab[0], (sizeof (sctab) / + sizeof (struct sctab)) - 1, + sizeof (struct sctab), namecmp); /* * print all the known symbols and their values diff --git a/usr/src/cmd/infocmp/infocmp.c b/usr/src/cmd/infocmp/infocmp.c index cdbcffa447..9e026f8b40 100644 --- a/usr/src/cmd/infocmp/infocmp.c +++ b/usr/src/cmd/infocmp/infocmp.c @@ -26,10 +26,10 @@ /* * Copyright 2004 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. + * + * Copyright (c) 2019, Joyent, Inc. */ -#pragma ident "%Z%%M% %I% %E% SMI" /* SVr4.0 1.13 */ - /* NAME infocmp - compare terminfo descriptions, or dump a terminfo @@ -185,9 +185,10 @@ allocvariables(int argc, int firstoptind) sizeof (struct strstruct)); /* Allocate array to keep track of which names have been used. */ - if (use) + if (use) { used = (char *) malloc((unsigned) (argc - firstoptind) * sizeof (char)); + } if ((ibool == NULL) || (num == NULL) || (str == NULL) || (use && (used == NULL))) @@ -203,8 +204,9 @@ allocvariables(int argc, int firstoptind) if (nullseen || (boolfnames[i] == NULL)) { ibool[i].fullname = "unknown_boolean"; nullseen = TRUE; - } else + } else { ibool[i].fullname = boolfnames[i]; + } ibool[i].changed = FALSE; ibool[i].seenagain = FALSE; } @@ -215,8 +217,9 @@ allocvariables(int argc, int firstoptind) if (nullseen || (numfnames[i] == NULL)) { ibool[i].fullname = "unknown_number"; nullseen = TRUE; - } else + } else { num[i].fullname = numfnames[i]; + } num[i].changed = FALSE; num[i].seenagain = FALSE; } @@ -227,8 +230,9 @@ allocvariables(int argc, int firstoptind) if (nullseen || (strfnames[i] == NULL)) { str[i].fullname = "unknown_string"; nullseen = TRUE; - } else + } else { str[i].fullname = strfnames[i]; + } str[i].changed = FALSE; str[i].seenagain = FALSE; } @@ -522,9 +526,10 @@ initfirstterm(char *term) { register int i; - if (verbose) + if (verbose) { (void) fprintf(trace, "setting up terminal type '%s'.\n", term); + } (void) setupterm(term, devnull, (int *) 0); @@ -542,8 +547,9 @@ initfirstterm(char *term) _savettytype[TTYLEN] = '\0'; savettytype = _savettytype; } - } else + } else { (void) strcpy(_savettytype, ttytype); + } } if (printing != pr_none) { @@ -554,12 +560,15 @@ initfirstterm(char *term) /* Save the values for the first terminal. */ for (i = 0; i < numbools; i++) { if ((ibool[i].val = tgetflag(ibool[i].capname)) && - printing != pr_none) + printing != pr_none) { pr_boolean(ibool[i].infoname, ibool[i].capname, ibool[i].fullname, 1); - if (verbose) + } + + if (verbose) { (void) fprintf(trace, "%s=%d.\n", ibool[i].infoname, ibool[i].val); + } } if (printing != pr_none) { @@ -571,12 +580,15 @@ initfirstterm(char *term) for (i = 0; i < numnums; i++) { if (((num[i].val = tgetnum(num[i].capname)) > -1) && - printing != pr_none) + printing != pr_none) { pr_number(num[i].infoname, num[i].capname, num[i].fullname, num[i].val); - if (verbose) + } + + if (verbose) { (void) fprintf(trace, "%s=%d.\n", num[i].infoname, num[i].val); + } } if (printing != pr_none) { @@ -588,9 +600,11 @@ initfirstterm(char *term) for (i = 0; i < numstrs; i++) { str[i].val = tgetstr(str[i].capname, (char **)0); - if ((str[i].val != NULL) && printing != pr_none) + if ((str[i].val != NULL) && printing != pr_none) { pr_string(str[i].infoname, str[i].capname, str[i].fullname, str[i].val); + } + if (verbose) { (void) fprintf(trace, "%s='", str[i].infoname); PR(trace, str[i].val); @@ -619,9 +633,10 @@ check_nth_terminal(char *nterm, int n) if (use) used[n] = FALSE; - if (verbose) + if (verbose) { (void) fprintf(trace, "adding in terminal type '%s'.\n", nterm); + } (void) setupterm(nterm, devnull, (int *) 0); @@ -679,20 +694,24 @@ check_nth_terminal(char *nterm, int n) } } if (boolval) { - if (printing != pr_none) + if (printing != pr_none) { pr_boolean(ibool[i].infoname, ibool[i].capname, ibool[i].fullname, 1); + } + if (common && (ibool[i].val == boolval)) (void) printf("\t%s= T.\n", ibool[i].infoname); - } else if (neither && !ibool[i].val) + } else if (neither && !ibool[i].val) { (void) printf("\t!%s.\n", ibool[i].infoname); + } if (diff && (ibool[i].val != boolval)) (void) printf("\t%s: %c:%c.\n", ibool[i].infoname, ibool[i].val?'T':'F', boolval?'T':'F'); - if (verbose) + if (verbose) { (void) fprintf(trace, "%s: %d:%d, changed=%d, " "seen=%d.\n", ibool[i].infoname, ibool[i].val, boolval, ibool[i].changed, ibool[i].seenagain); + } } if (printing != pr_none) { @@ -733,22 +752,31 @@ check_nth_terminal(char *nterm, int n) } } if (numval > -1) { - if (printing != pr_none) + if (printing != pr_none) { pr_number(num[i].infoname, num[i].capname, num[i].fullname, numval); - if (common && (num[i].val == numval)) + } + + if (common && (num[i].val == numval)) { (void) printf("\t%s= %d.\n", num[i].infoname, numval); - } else if (neither && (num[i].val == -1)) - (void) printf("\t!%s.\n", num[i].infoname); - if (diff && (num[i].val != numval)) - (void) printf("\t%s: %d:%d.\n", - num[i].infoname, num[i].val, numval); - if (verbose) - (void) fprintf(trace, "%s: %d:%d, " - "changed = %d, seen = %d.\n", - num[i].infoname, num[i].val, numval, - num[i].changed, num[i].seenagain); + } + + } else if (neither && (num[i].val == -1)) { + (void) printf("\t!%s.\n", num[i].infoname); + } + + if (diff && (num[i].val != numval)) { + (void) printf("\t%s: %d:%d.\n", + num[i].infoname, num[i].val, numval); + } + + if (verbose) { + (void) fprintf(trace, "%s: %d:%d, " + "changed = %d, seen = %d.\n", + num[i].infoname, num[i].val, numval, + num[i].changed, num[i].seenagain); + } } if (printing != pr_none) { @@ -791,9 +819,11 @@ check_nth_terminal(char *nterm, int n) } } if (strval != NULL) { - if (printing != pr_none) + if (printing != pr_none) { pr_string(str[i].infoname, str[i].capname, str[i].fullname, strval); + } + if (common && EQUAL(str[i].val, strval)) { (void) printf("\t%s= '", str[i].infoname); PR(stdout, strval); @@ -848,48 +878,57 @@ dorelative(int firstoptind, int argc, char **argv) pr_bheading(); /* Print out all bools that are different. */ - for (i = 0; i < numbools; i++) - if (!ibool[i].val && ibool[i].changed) + for (i = 0; i < numbools; i++) { + if (!ibool[i].val && ibool[i].changed) { pr_boolean(ibool[i].infoname, (char *)0, (char *)0, -1); - else if (ibool[i].val && (ibool[i].changed || - !ibool[i].seenagain)) + } else if (ibool[i].val && (ibool[i].changed || + !ibool[i].seenagain)) { pr_boolean(ibool[i].infoname, (char *)0, (char *)0, 1); + } + } pr_bfooting(); pr_nheading(); /* Print out all nums that are different. */ - for (i = 0; i < numnums; i++) - if (num[i].val < 0 && num[i].changed) + for (i = 0; i < numnums; i++) { + if (num[i].val < 0 && num[i].changed) { pr_number(num[i].infoname, (char *)0, (char *)0, -1); - else if (num[i].val >= 0 && (num[i].changed || - !num[i].seenagain)) + } else if (num[i].val >= 0 && (num[i].changed || + !num[i].seenagain)) { pr_number(num[i].infoname, (char *)0, (char *)0, num[i].val); + } + } pr_nfooting(); pr_sheading(); /* Print out all strs that are different. */ - for (i = 0; i < numstrs; i++) - if (str[i].val == NULL && str[i].changed) + for (i = 0; i < numstrs; i++) { + if (str[i].val == NULL && str[i].changed) { pr_string(str[i].infoname, (char *)0, (char *)0, (char *)0); - else if ((str[i].val != NULL) && - (str[i].changed || !str[i].seenagain)) - pr_string(str[i].infoname, (char *)0, (char *)0, str[i].val); + } else if ((str[i].val != NULL) && + (str[i].changed || !str[i].seenagain)) { + pr_string(str[i].infoname, + (char *)0, (char *)0, str[i].val); + } + } pr_sfooting(); /* Finish it up. */ - for (i = firstoptind; i < argc; i++) - if (used[i - firstoptind]) + for (i = firstoptind; i < argc; i++) { + if (used[i - firstoptind]) { (void) printf("\tuse=%s,\n", argv[i]); - else + } else { (void) fprintf(stderr, "%s: 'use=%s' did not add anything to the " "description.\n", progname, argv[i]); + } + } } void @@ -903,9 +942,11 @@ local_setenv(char *termNinfo) register int termlen; if (termNinfo && *termNinfo) { - if (verbose) + if (verbose) { (void) fprintf(trace, "setting TERMINFO=%s.\n", termNinfo); + } + termlen = strlen(termNinfo); if (termlen + 10 > termsize) { termsize = termlen + 20; @@ -1052,12 +1093,13 @@ main(int argc, char **argv) optind = 0; } pr_init(printing = pr_terminfo); - } else + } else { diff++; + } } /* Set the default sorting order. */ - if (sortorder == none) + if (sortorder == none) { switch ((int) printing) { case (int) pr_cap: sortorder = by_cap; break; @@ -1067,6 +1109,7 @@ main(int argc, char **argv) case (int) pr_none: sortorder = by_terminfo; break; } + } firstterm = argv[optind++]; firstoptind = optind; diff --git a/usr/src/cmd/mdb/common/modules/genunix/ldi.c b/usr/src/cmd/mdb/common/modules/genunix/ldi.c index 1df7fd1120..a3ceb64421 100644 --- a/usr/src/cmd/mdb/common/modules/genunix/ldi.c +++ b/usr/src/cmd/mdb/common/modules/genunix/ldi.c @@ -24,6 +24,10 @@ * Use is subject to license terms. */ +/* + * Copyright (c) 2018, Joyent, Inc. + */ + #include <sys/types.h> #include <sys/sysmacros.h> #include <sys/dditypes.h> @@ -377,7 +381,8 @@ ldi_handle(uintptr_t addr, uint_t flags, int argc, const mdb_arg_t *argv) argc, argv) == -1) { mdb_warn("can't walk ldi handles"); return (DCMD_ERR); - } return (DCMD_OK); + } + return (DCMD_OK); } /* display the header line */ diff --git a/usr/src/cmd/ndmpadm/ndmpadm_main.c b/usr/src/cmd/ndmpadm/ndmpadm_main.c index 6cc7cbb7bc..8f6da4b052 100644 --- a/usr/src/cmd/ndmpadm/ndmpadm_main.c +++ b/usr/src/cmd/ndmpadm/ndmpadm_main.c @@ -1,6 +1,7 @@ /* * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2015 Nexenta Systems, Inc. All rights reserved. + * Copyright (c) 2018, Joyent, Inc. */ /* @@ -333,7 +334,7 @@ ndmp_set_config_process(char *propname) if ((propvalue = strchr(propname, '=')) == NULL) { (void) fprintf(stderr, gettext("Missing value in " "property=value argument for %s\n"), propname); - return; + return; } *propvalue = '\0'; propvalue++; @@ -341,7 +342,7 @@ ndmp_set_config_process(char *propname) if (*propname == '\0') { (void) fprintf(stderr, gettext("Missing property in " "property=value argument for %s\n"), propname); - return; + return; } for (j = 0; j < NDMPADM_NPROP; j++) { if (strcmp(propname, prop_table[j]) == 0) @@ -513,7 +514,7 @@ ndmp_kill_sessions(int argc, char **argv, ndmp_command_t *cur_cmd) } else { (void) fprintf(stderr, gettext("Invalid argument %s\n"), argv[i]); - continue; + continue; } if (ret == -1) (void) fprintf(stdout, diff --git a/usr/src/cmd/pathchk/pathchk.c b/usr/src/cmd/pathchk/pathchk.c index 23c9ed91e8..b3ed05a4c5 100644 --- a/usr/src/cmd/pathchk/pathchk.c +++ b/usr/src/cmd/pathchk/pathchk.c @@ -20,8 +20,8 @@ * CDDL HEADER END */ /* - * - * Copyright (c) 1994 by Sun Microsystems, Inc. + * Copyright (c) 1994 by Sun Microsystems, Inc. + * Copyright (c) 2018, Joyent, Inc. */ /* @@ -31,7 +31,6 @@ * P1003.2/D11.2 * */ -#pragma ident "%Z%%M% %I% %E% SMI" /* * Original ident string for reference * ident "$Id: pathchk.c,v 1.29 1994/05/24 15:51:19 mark Exp $" @@ -247,7 +246,7 @@ checkpathname(char *path, int pflag) * Find the end of the current component * and check for valid characters in the component */ - while (*p != '\0' && !M_FSDELIM(*p)) { + while (*p != '\0' && !M_FSDELIM(*p)) { /* * for pflag: check for PFCS characters * otherwise assume all characters are valid @@ -280,13 +279,13 @@ checkpathname(char *path, int pflag) * are required when not just * checking for portability. */ - struct stat sb; - char fsdelim; + struct stat sb; + char fsdelim; - fsdelim = *ecomp; - *ecomp = '\0'; + fsdelim = *ecomp; + *ecomp = '\0'; - if (stat(path, &sb) == -1) { + if (stat(path, &sb) == -1) { /* * We error out if an * intermediate component @@ -303,7 +302,7 @@ checkpathname(char *path, int pflag) } else if (errno == ENOENT) { checkStat = 0; } - } else if (S_ISDIR(sb.st_mode)) { + } else if (S_ISDIR(sb.st_mode)) { /* * If the current prefix is a * directory, then we need to diff --git a/usr/src/cmd/pcitool/pcitool_ui.c b/usr/src/cmd/pcitool/pcitool_ui.c index ddeccea4bf..20e3956222 100644 --- a/usr/src/cmd/pcitool/pcitool_ui.c +++ b/usr/src/cmd/pcitool/pcitool_ui.c @@ -21,6 +21,7 @@ /* * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2012 Milan Jurik. All rights reserved. + * Copyright (c) 2018, Joyent, Inc. */ /* @@ -1424,7 +1425,7 @@ parse_intr_set_opts(char *input, uint64_t *flags_arg, uint32_t *cpu_arg) } else { (void) fprintf(stderr, "Unrecognized option for -i -m -w\n"); - rval = FAILURE; + rval = FAILURE; } return (rval); diff --git a/usr/src/cmd/pg/pg.c b/usr/src/cmd/pg/pg.c index 2218c9abf3..f4ce5ddeff 100644 --- a/usr/src/cmd/pg/pg.c +++ b/usr/src/cmd/pg/pg.c @@ -22,6 +22,7 @@ /* * Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2016 by Delphix. All rights reserved. + * Copyright (c) 2018, Joyent, Inc. */ /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ @@ -226,7 +227,7 @@ main(int argc, char **argv) /* check for non-standard + option */ for (i = 1; i < argc; i++) { if (strcmp(argv[i], "--") == 0) - break; + break; if (argv[i][0] == '+') { if (argv[i][1] == '/') { diff --git a/usr/src/cmd/sbdadm/sbdadm.c b/usr/src/cmd/sbdadm/sbdadm.c index c2323e11b1..dfabdd7a3a 100644 --- a/usr/src/cmd/sbdadm/sbdadm.c +++ b/usr/src/cmd/sbdadm/sbdadm.c @@ -22,6 +22,7 @@ * Copyright 2010 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. * Copyright 2012 Milan Jurik. All rights reserved. + * Copyright (c) 2018, Joyent, Inc. */ #include <stdlib.h> #include <stdio.h> @@ -316,7 +317,7 @@ delete_lu(int operandLen, char *operands[], cmdOptions_t *options, notValidHexNumber = B_TRUE; break; } - sGuid[j] = tolower(operands[i][j]); + sGuid[j] = tolower(operands[i][j]); } if ((notValidHexNumber == B_TRUE) || (strlen(operands[i]) != GUID_INPUT)) { diff --git a/usr/src/cmd/sgs/ar/common/main.c b/usr/src/cmd/sgs/ar/common/main.c index a452d403ff..e5667aa196 100644 --- a/usr/src/cmd/sgs/ar/common/main.c +++ b/usr/src/cmd/sgs/ar/common/main.c @@ -25,6 +25,10 @@ * Copyright (c) 1995, 2010, Oracle and/or its affiliates. All rights reserved. */ +/* + * Copyright (c) 2018, Joyent, Inc. + */ + #include "inc.h" #include "conv.h" @@ -277,7 +281,7 @@ setup(int argc, char *argv[], Cmd_info *cmd_info) MSG_ORIG(MSG_FMT_VERSION), (const char *)SGU_PKG, (const char *)SGU_REL); - Vflag++; + Vflag++; } break; case 'C': diff --git a/usr/src/cmd/sgs/m4/common/m4.c b/usr/src/cmd/sgs/m4/common/m4.c index e96fb17c26..8888f49eef 100644 --- a/usr/src/cmd/sgs/m4/common/m4.c +++ b/usr/src/cmd/sgs/m4/common/m4.c @@ -30,6 +30,10 @@ /* Copyright (c) 1988 AT&T */ /* All Rights Reserved */ +/* + * Copyright (c) 2018, Joyent, Inc. + */ + #include <signal.h> #include <unistd.h> #include <fcntl.h> @@ -576,7 +580,7 @@ expand(wchar_t **a1, int c) pbstr(lquote); if (i <= 0) - break; + break; pbstr(L","); } diff --git a/usr/src/cmd/syseventd/daemons/syseventd/sysevent_client.c b/usr/src/cmd/syseventd/daemons/syseventd/sysevent_client.c index 04a410991b..155b59eab1 100644 --- a/usr/src/cmd/syseventd/daemons/syseventd/sysevent_client.c +++ b/usr/src/cmd/syseventd/daemons/syseventd/sysevent_client.c @@ -24,7 +24,9 @@ * All rights reserved. */ -#pragma ident "%Z%%M% %I% %E% SMI" +/* + * Copyright (c) 2018, Joyent, Inc. + */ /* * syseventd client interfaces @@ -121,7 +123,7 @@ insert_client(void *client_data, int client_type, int retry_limit) NULL); (void) mutex_unlock(&scp->client_lock); (void) mutex_unlock(&client_tbl_lock); - return (i); + return (i); } } diff --git a/usr/src/cmd/ucodeadm/ucodeadm.c b/usr/src/cmd/ucodeadm/ucodeadm.c index 1ff85bcf0d..67a7bae882 100644 --- a/usr/src/cmd/ucodeadm/ucodeadm.c +++ b/usr/src/cmd/ucodeadm/ucodeadm.c @@ -23,6 +23,10 @@ * Use is subject to license terms. */ +/* + * Copyright (c) 2018, Joyent, Inc. + */ + #include <sys/types.h> #include <sys/processor.h> #include <sys/ucode.h> @@ -668,9 +672,9 @@ main(int argc, char *argv[]) uint32_t *revp = NULL; int i; #if defined(_SYSCALL32_IMPL) - struct ucode_get_rev_struct32 inf32; + struct ucode_get_rev_struct32 inf32; #else - struct ucode_get_rev_struct info; + struct ucode_get_rev_struct info; #endif cpuid_max = (processorid_t)sysconf(_SC_CPUID_MAX); @@ -721,9 +725,9 @@ main(int argc, char *argv[]) if (action & UCODE_OPT_UPDATE) { int tmprc; #if defined(_SYSCALL32_IMPL) - struct ucode_write_struct32 uw_struct32; + struct ucode_write_struct32 uw_struct32; #else - struct ucode_write_struct uw_struct; + struct ucode_write_struct uw_struct; #endif #if defined(_SYSCALL32_IMPL) diff --git a/usr/src/cmd/ul/ul.c b/usr/src/cmd/ul/ul.c index d4cfa6ea5f..272df43eb7 100644 --- a/usr/src/cmd/ul/ul.c +++ b/usr/src/cmd/ul/ul.c @@ -12,7 +12,9 @@ * specifies the terms and conditions for redistribution. */ -#pragma ident "%Z%%M% %I% %E% SMI" +/* + * Copyright (c) 2018, Joyent, Inc. + */ #include <stdio.h> #include <locale.h> @@ -460,7 +462,7 @@ iattr(void) tszbf += n * MEMFCT; } tszbf -= n; - *cp++ = cx; + *cp++ = cx; while (--n > 0) { *cp++ = cx; i++; diff --git a/usr/src/cmd/valtools/ckitem.c b/usr/src/cmd/valtools/ckitem.c index c56794f50d..61f9f85655 100644 --- a/usr/src/cmd/valtools/ckitem.c +++ b/usr/src/cmd/valtools/ckitem.c @@ -28,7 +28,9 @@ /* All Rights Reserved */ -#pragma ident "%Z%%M% %I% %E% SMI" +/* + * Copyright (c) 2018, Joyent, Inc. + */ #include <stdio.h> #include <ctype.h> @@ -146,7 +148,7 @@ main(int argc, char **argv) if (!invis) { (void) fprintf(stderr, gettext("Not enough memory\n")); - exit(1); + exit(1); } while ((c = getopt(argc, argv, "m:oni:l:f:ud:p:e:h:k:s:QW:?")) != EOF) { /* check for invalid option */ @@ -197,7 +199,7 @@ main(int argc, char **argv) if (!invis) { (void) fprintf(stderr, gettext("Not enough memory\n")); - exit(1); + exit(1); } (void) memset(invis + ninvis, 0, (invismaxsize - ninvis) * diff --git a/usr/src/cmd/write/write.c b/usr/src/cmd/write/write.c index 7518cf85ab..6683af7f85 100644 --- a/usr/src/cmd/write/write.c +++ b/usr/src/cmd/write/write.c @@ -27,6 +27,7 @@ * Copyright 2004 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. * Copyright (c) 2016 by Delphix. All rights reserved. + * Copyright (c) 2018, Joyent, Inc. */ #pragma ident "%Z%%M% %I% %E% SMI" @@ -274,9 +275,9 @@ main(int argc, char **argv) (void) fprintf(stderr, gettext("Cannot determine who you are.\n")); exit(1); - } - (void) strlcpy(&ownname[0], &passptr->pw_name[0], - sizeof (ownname)); + } + (void) strlcpy(&ownname[0], &passptr->pw_name[0], + sizeof (ownname)); } else { (void) strlcpy(&ownname[0], self.ut_user, sizeof (self.ut_user)); diff --git a/usr/src/cmd/zdump/zdump.c b/usr/src/cmd/zdump/zdump.c index eae12f775f..8c3a32bc8f 100644 --- a/usr/src/cmd/zdump/zdump.c +++ b/usr/src/cmd/zdump/zdump.c @@ -4,6 +4,10 @@ */ /* + * Copyright (c) 2018, Joyent, Inc. + */ + +/* * zdump 7.24 * Taken from elsie.nci.nih.gov to replace the existing Solaris zdump, * which was based on an earlier version of the elsie code. @@ -231,8 +235,9 @@ char *argv[]; cutloyear = lo; cuthiyear = hi; } else { -(void) fprintf(stderr, gettext("%s: wild -c argument %s\n"), - progname, cutarg); + (void) fprintf(stderr, + gettext("%s: wild -c argument %s\n"), + progname, cutarg); exit(EXIT_FAILURE); } } |