diff options
| author | Jerry Jelinek <jerry.jelinek@joyent.com> | 2019-07-08 11:54:30 +0000 |
|---|---|---|
| committer | Jerry Jelinek <jerry.jelinek@joyent.com> | 2019-07-08 11:54:30 +0000 |
| commit | 374965e669006070cff81f276f2e13f54c6d9d51 (patch) | |
| tree | c1d4b02e6e03da4d07e6cb1aeb72d38fdf8eca30 /usr/src/cmd | |
| parent | b69647d3aacd223817db151e369b34ec2471cf28 (diff) | |
| parent | c8d9a41c357577f316e58fb2603f85c598f01afb (diff) | |
| download | illumos-joyent-374965e669006070cff81f276f2e13f54c6d9d51.tar.gz | |
[illumos-gate merge]
commit c8d9a41c357577f316e58fb2603f85c598f01afb
11243 Unused headers under usr/src/uts/sun4u/sys
commit 2dda0e7f85eecc34a1f266469e66651eab1fa7ce
11242 Unused files in usr/src/cmd/logins
commit 6da5c920d0507dbc9e0e4416dcb9457827560df9
11241 usr/src/lib/libpkg/THIRDPARTYLICENSE.descrip is unused
commit 5abf55fdc38fe5c2d8881a37a662d372c23fd0aa
11240 usr/src/pkg/proto_list_ihv_i386 is unused
commit 57884e4a5db25b4d70c3565a0e07980fd7820c1e
11302 csh: NULL pointer errors
commit 4c719f3bd8ab1791d6763012560603c65390008c
11301 cpio: NULL pointer errors
commit ee0bd0a5a4b4a9cdbe27d56415fe460db258a9ef
11331 A typo in usr/src/man/man1/ls.1
commit 3fa8bc2d19bd24fbc2061549c236b6f7573471e8
11325 SES-3 element index handling incorrect
commit 3d4dea7f235476fb40c0a6d84dcedfd04740f96b
11299 csplit: NULL pointer errors
commit d95bfcb7b300250d00a64080d6da927b04ac4697
11298 consadm: NULL pointer errors
commit 0f063ce817df80cc8fb489abe02246d3d750d2fd
11297 chmod: NULL pointer errors
commit 95c745183e701047fab8e4753d4e8bc1dd1323e7
11296 cmd-inet: NULL pointer errors
commit 89b213ac9ac098a69d51b5e8693bd6b8d51864a8
11314 Provide psm_get_ipivect even on single CPU systems
commit 619456cb54d66ca9736dc29a93b6bb375f41db14
11321 eeprom: NULL pointer errors
commit eeec397864011c5afca614fe1353754d7a9d852f
11320 diskinfo: NULL pointer errors
commit 5f8fc372c68f2e0f1544c42850078877e5e2da3a
11318 svc: NULL pointer errors
commit ff8e166f73f3bfaeac25d65662c6469130892500
11312 dladm: NULL pointer errors
commit 1376f37367e2b1424b82940f492f2ed488f1b843
11311 devctl: NULL pointer errors
commit e4fb8a5fd5bb5a5d316430c6ac8f6d33704fcf5d
11295 lp: NULL pointer errors
commit 07c94cbf80ccbba93ea61425c2074f6bfd608a19
11294 abi: NULL pointer errors
commit beb02e13b243c53c69d40b808b9ce43bafe55b88
11293 cfgadm: NULL pointer errors
commit 8d499c80c8e6e058669db8815577bc1d4dca9af0
11022 Offload Data Transfer (ODX) support
commit 252bc4b276969afed9d61561c1a53f4cad070a6b
11021 more SMB2 ioctls
commit 55f0a249fd3511728b02627190771a4ce4ddf20e
11020 want SMB2 ioctl FSCTL_SRV_COPYCHUNK
commit 98e973578ca69ba3ce659c761190cbf3558d359c
11292 allocate: NULL pointer errors
commit 82be58ff71c54701f4bfbbb526b4ea3d8f899c22
11289 backup: NULL pointer errors
commit 09f57adea580808a172a5b3e84bf41dc7e0cee6d
11291 bnu: NULL pointer errors
commit 6473113318cb70acc95fbd8ac12c39566c7b9ee1
11285 audio: NULL pointer errors
commit 23b5da0c3a749777311c1644e6ed463cc072104c
11288 bootadm: NULL pointer errors
commit b04056ece904a6664d34ccc4015b5373e959983e
11287 acct: NULL pointer errors
commit 5f2732295e86666b0e9cf16ad42da252d29d0e40
11286 bart: NULL pointer errors
commit 1c124bccd08a671182130ddf2af8e454734b3897
10255 SES temperature thresholds 20 degrees too hot
commit 6a6cfa5d0723a95a9ad915bdb8ca2c9731449041
11267 Add rust demangling support
commit 773dbec304e9344130c5ae4aa5fc8db5419ff779
11268 Add custom allocators to libcustr
commit 09cb6b0fb8744ab06f86a15ad49eb1f39c6fcbf1
11280 custr in belt but not braces, bungles vsnprintf() buffer length
commit ff168298deb08c70659ec1a8645952dee5150368
11165 libshare: NULL pointer errors
commit f810c7e5159aec14e1937d86287a006e755d3d99
11164 libkmf: NULL pointer errors
commit 67d74cc3e7c9d9461311136a0b2069813a3fd927
11102 rtld: NULL pointer errors
commit f39d86306993aa102221c6e62702f1de6cc3f56c
11116 libgen: NULL pointer errors
commit b168296d3fe15e5a2f992bf6af96993c6756ff3a
11155 brand: NULL pointer errors
commit 6f6dd2ca9f4a235a0b2ab596d23cbbfd44d684f6
11113 libgss: NULL pointer errors
commit c75682cd39b9b3d382ce1b01fef06a84ca7ea0a9
11133 libproc: NULL pointer errors
commit 6e6545bfaed3bab9ce836ee82d1abd8f2edba89a
11169 nsswitch: NULL pointer errors
commit f5f1a62e51e5e35359add22ba492c3e3a8f12654
11146 libmapid: NULL pointer errors
commit 6afa3d1d6776a3db46447deaa893bd35c9b53c0a
11147 libinetsvc: NULL pointer errrors
commit c3e74f84d7edf7b5144c2401d7fefd666a92e6c0
11122 libc_db: NULL pointer errors
Conflicts:
usr/src/lib/libdemangle/common/rust.c
usr/src/test/util-tests/tests/demangle/Makefile
Diffstat (limited to 'usr/src/cmd')
91 files changed, 376 insertions, 481 deletions
diff --git a/usr/src/cmd/abi/appcert/static_prof/static_prof.c b/usr/src/cmd/abi/appcert/static_prof/static_prof.c index 7d2d71c20f..83bd3c5fcc 100644 --- a/usr/src/cmd/abi/appcert/static_prof/static_prof.c +++ b/usr/src/cmd/abi/appcert/static_prof/static_prof.c @@ -331,7 +331,7 @@ obj_init(obj_list * c) "File <<%s>> : Already opened.\n", c->obj->ename); } - c->obj->fd = NULL; + c->obj->fd = 0; return (FAIL); } /* diff --git a/usr/src/cmd/abi/spectrans/spec2map/bucket.c b/usr/src/cmd/abi/spectrans/spec2map/bucket.c index 5a031a1706..77f2374775 100644 --- a/usr/src/cmd/abi/spectrans/spec2map/bucket.c +++ b/usr/src/cmd/abi/spectrans/spec2map/bucket.c @@ -24,8 +24,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include <stdio.h> #include <malloc.h> #include <stdlib.h> @@ -724,7 +722,7 @@ checksum(const char *p) { int sum; - for (sum = 0; *p != NULL; ++p) { + for (sum = 0; *p != '\0'; ++p) { if (sum & 01) sum = (sum >> 1) + 0x8000; else diff --git a/usr/src/cmd/abi/spectrans/spec2trace/bindings.c b/usr/src/cmd/abi/spectrans/spec2trace/bindings.c index 7c6f7d74de..95d937230c 100644 --- a/usr/src/cmd/abi/spectrans/spec2trace/bindings.c +++ b/usr/src/cmd/abi/spectrans/spec2trace/bindings.c @@ -24,8 +24,6 @@ * All rights reserved. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include <stdio.h> #include <string.h> #include "parser.h" @@ -169,7 +167,7 @@ generate_a_binding(char *name, char *value) char *q; errlog(BEGIN, "generate_a_binding() {"); - if (*value == NULL) { + if (*value == '\0') { errlog(FATAL, "programmer error: asked to generate an " "empty binding"); } @@ -191,7 +189,7 @@ generate_a_binding(char *name, char *value) /* Walk across line, emitting tokens and transformed tokens */ - for (; *p != NULL; p = q) { + for (; *p != '\0'; p = q) { p = skipb(p); q = nextsep(p); @@ -254,7 +252,7 @@ strpqcmp(char *v1, char *p, char *q) errlog(BEGIN, "strpqcmp() {"); saved = *q; - *q = NULL; + *q = '\0'; rc = (strcmp(v1, p)); *q = saved; errlog(END, "}"); @@ -271,7 +269,7 @@ strpqprint(char *p, char *q, FILE *fp) errlog(BEGIN, "strpqprint() {"); saved = *q; - *q = NULL; + *q = '\0'; (void) fputs(p, fp); *q = saved; errlog(END, "}"); diff --git a/usr/src/cmd/abi/spectrans/spec2trace/db.c b/usr/src/cmd/abi/spectrans/spec2trace/db.c index 6540bb6a37..df1090b960 100644 --- a/usr/src/cmd/abi/spectrans/spec2trace/db.c +++ b/usr/src/cmd/abi/spectrans/spec2trace/db.c @@ -24,8 +24,6 @@ * All rights reserved. */ -#pragma ident "%Z%%M% %I% %E% SMI" - /* * db.c -- the tiny database for trace. Only stores * global things: see symtab for per-function data. @@ -74,7 +72,7 @@ db_set_current_library(char const *p) errlog(BEGIN, "db_set_current_library() {"); (void) strncpy(Database.Current_Library, p, sizeof (Database.Current_Library)); - Database.Current_Library[sizeof (Database.Current_Library) - 1] = NULL; + Database.Current_Library[sizeof (Database.Current_Library) - 1] = '\0'; errlog(END, "}"); } @@ -187,7 +185,7 @@ db_get_output_file(void) char *p, *q; errlog(BEGIN, "db_get_output_file() {"); - if (*Database.Output_File != NULL) { + if (*Database.Output_File != '\0') { /* It was set with the -o option */ errlog(VERBOSE, "output file from -o = '%s'\n", Database.Output_File); diff --git a/usr/src/cmd/abi/spectrans/spec2trace/interceptor.c b/usr/src/cmd/abi/spectrans/spec2trace/interceptor.c index e95765926a..7c8280715b 100644 --- a/usr/src/cmd/abi/spectrans/spec2trace/interceptor.c +++ b/usr/src/cmd/abi/spectrans/spec2trace/interceptor.c @@ -24,8 +24,6 @@ * All rights reserved. */ -#pragma ident "%Z%%M% %I% %E% SMI" - /* * interceptor.c -- a functional decomposition of generate.c, * the code generator for apptrace @@ -168,7 +166,7 @@ generate_i_declarations(char *errname, int voidfunc, char *ret_str) { errlog(BEGIN, "generate_i_declarations() {"); - if (*errname != NULL) { + if (*errname != '\0') { /* Create locals for errno-type variable, */ (void) fprintf(Bodyfp, " int saved_errvar = %s;\n", errname); @@ -230,7 +228,7 @@ generate_i_call( errlog(BEGIN, "generate_i_call() {"); /* Zero the error variable. */ - if (*error_name != NULL) { + if (*error_name != '\0') { (void) fprintf(Bodyfp, " %s = 0;\n", error_name); } @@ -246,7 +244,7 @@ generate_i_call( } /* Then set the local copy of the error variable. */ - if (*error_name != NULL) { + if (*error_name != '\0') { (void) fprintf(Bodyfp, " functions_errvar = %s;\n", error_name); } @@ -387,7 +385,7 @@ generate_i_closedown(char *error_name, int void_func) (void) fprintf(Bodyfp, " abiunlock(&omask);\n"); - if (*error_name != NULL) { + if (*error_name != '\0') { /* Restore error variables. */ (void) fprintf(Bodyfp, " %s = (functions_errvar == 0)? " diff --git a/usr/src/cmd/abi/spectrans/spec2trace/printfuncs.c b/usr/src/cmd/abi/spectrans/spec2trace/printfuncs.c index 22dea8d903..e42a59763e 100644 --- a/usr/src/cmd/abi/spectrans/spec2trace/printfuncs.c +++ b/usr/src/cmd/abi/spectrans/spec2trace/printfuncs.c @@ -24,8 +24,6 @@ * All rights reserved. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include <stdlib.h> #include <stdio.h> #include <string.h> @@ -60,7 +58,7 @@ generate_printf(ENTRY *f) (void) fprintf(Bodyfp, " fprintf(ABISTREAM, \""); p = &arglist[0]; l = (int)sizeof (arglist); - *p = NULL; + *p = '\0'; for (e = symtab_get_first_arg(); e != NULL; e = symtab_get_next_arg()) { errlog(TRACING, "arglist = '%s'", arglist); @@ -72,7 +70,7 @@ generate_printf(ENTRY *f) if (p != &arglist[0]) { (void) fprintf(Bodyfp, ", "); } - if (*(name = name_of(e)) == NULL) { + if (*(name = name_of(e)) == '\0') { /* It's a varargs indicator instead */ (void) fprintf(Bodyfp, "..."); } else { @@ -80,7 +78,7 @@ generate_printf(ENTRY *f) n = prepare_printf_part(e, name, p, l); l -= n; p += n; - *(p+1) = NULL; + *(p+1) = '\0'; } } @@ -156,7 +154,7 @@ generate_printfunc_calls(ENTRY *f) if (is_void(e)) { break; } - if (*(name = name_of(e)) == NULL) { + if (*(name = name_of(e)) == '\0') { (void) fprintf(Bodyfp, " fputs(\" ...\\n\", " "ABISTREAM);\n"); } @@ -231,7 +229,7 @@ generate_print_definitions(FILE *fp) print_type != NULL; print_type = db_get_next_print_type()) { c_type = strchr(print_type, ','); /* Safe by construction. */ - *c_type++ = NULL; + *c_type++ = '\0'; errlog(TRACING, "print_type=%s\n", print_type); pf_str_name = space_to_uscore(print_type); @@ -268,7 +266,7 @@ generate_print_declarations(FILE *fp) errlog(TRACING, "print_type, c_type=%s\n", print_type); c_type = strchr(print_type, ','); /* Safe by construction. */ - *c_type++ = NULL; + *c_type++ = '\0'; pf_str_name = space_to_uscore(print_type); diff --git a/usr/src/cmd/abi/spectrans/spec2trace/symtab.c b/usr/src/cmd/abi/spectrans/spec2trace/symtab.c index 9eba8969bb..7f19ed48ba 100644 --- a/usr/src/cmd/abi/spectrans/spec2trace/symtab.c +++ b/usr/src/cmd/abi/spectrans/spec2trace/symtab.c @@ -24,8 +24,6 @@ * All rights reserved. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include <stdio.h> #include <string.h> #include <limits.h> @@ -147,10 +145,10 @@ symtab_clear_function(void) errlog(BEGIN, "symtab_clear_function() {"); Symtab.Function = free_entry(Symtab.Function); Symtab.Args = free_entry_table(Symtab.Args); - Symtab.Prototype[0] = NULL; - Symtab.Formals[0] = NULL; - Symtab.Actuals[0] = NULL; - Symtab.Cast[0] = NULL; + Symtab.Prototype[0] = '\0'; + Symtab.Formals[0] = '\0'; + Symtab.Actuals[0] = '\0'; + Symtab.Cast[0] = '\0'; errlog(END, "}"); } @@ -224,7 +222,7 @@ symtab_set_prototype(char *p) errlog(BEGIN, "symtab_set_prototype(void) {"); (void) strncpy(Symtab.Prototype, p, sizeof (Symtab.Prototype)); - Symtab.Prototype[sizeof (Symtab.Prototype)-1] = NULL; + Symtab.Prototype[sizeof (Symtab.Prototype)-1] = '\0'; errlog(END, "}"); } @@ -241,7 +239,7 @@ symtab_set_formals(char *p) errlog(BEGIN, "symtab_set_formals() {"); errlog(VERBOSE, "p = %s", p); (void) strncpy(Symtab.Formals, p, sizeof (Symtab.Formals)); - Symtab.Formals[sizeof (Symtab.Formals)-1] = NULL; + Symtab.Formals[sizeof (Symtab.Formals)-1] = '\0'; errlog(END, "}"); } @@ -258,7 +256,7 @@ symtab_set_actuals(char *p) errlog(BEGIN, "symtab_set_actuals() {"); errlog(END, "}"); errlog(VERBOSE, "p = %s", p); (void) strncpy(Symtab.Actuals, p, sizeof (Symtab.Actuals)); - Symtab.Actuals[sizeof (Symtab.Actuals)-1] = NULL; + Symtab.Actuals[sizeof (Symtab.Actuals)-1] = '\0'; } char * @@ -273,7 +271,7 @@ symtab_set_cast(char *p) { errlog(BEGIN, "symtab_set_cast() {"); errlog(END, "}"); (void) strncpy(Symtab.Cast, p, sizeof (Symtab.Cast)); - Symtab.Cast[sizeof (Symtab.Cast)-1] = NULL; + Symtab.Cast[sizeof (Symtab.Cast)-1] = '\0'; } char * @@ -289,7 +287,7 @@ symtab_set_filename(const char *p) { errlog(BEGIN, "symtab_set_filename() {"); errlog(END, "}"); (void) strncpy(Symtab.Filename, p, sizeof (Symtab.Filename)); - Symtab.Filename[sizeof (Symtab.Filename)-1] = NULL; + Symtab.Filename[sizeof (Symtab.Filename)-1] = '\0'; } char * @@ -686,14 +684,14 @@ type_of(ENTRY *e) if (e != NULL && (e->e_kind == PRIMITIVE || e->e_kind == VARARG)) { p = e->e_type; q = &buffer[0]; - while (*p != NULL) { + while (*p != '\0') { if (*p == '%') { p += 2; } else { *q++ = *p++; } } - *q = NULL; + *q = '\0'; return (strtrim(&buffer[0])); } else @@ -715,7 +713,7 @@ levels_of(ENTRY *e) if (e != NULL && (e->e_kind == PRIMITIVE || e->e_kind == VARARG)) return (e->e_levels); else - return (NULL); + return (0); } char * diff --git a/usr/src/cmd/abi/spectrans/spec2trace/trace.c b/usr/src/cmd/abi/spectrans/spec2trace/trace.c index a9fab97c02..1a80ad1512 100644 --- a/usr/src/cmd/abi/spectrans/spec2trace/trace.c +++ b/usr/src/cmd/abi/spectrans/spec2trace/trace.c @@ -24,8 +24,6 @@ * All rights reserved. */ -#pragma ident "%Z%%M% %I% %E% SMI" - /* * * trace.c -- a simple translator from spec source to c source for @@ -628,8 +626,8 @@ to_basetype(char *str) int levels = 0; assert(strlen(str) < MAXLINE, "string exceeded MAXLINE"); - buffer[0] = NULL; - for (; *p != NULL; p++) { + buffer[0] = '\0'; + for (; *p != '\0'; p++) { switch (*p) { case ' ': /* Convert spaces to single ' '. */ if (*(q-1) != ' ') @@ -652,12 +650,12 @@ to_basetype(char *str) *q++ = *p; break; } - *q = NULL; + *q = '\0'; } assert(q < &buffer[MAXLINE], "q fell off end of buffer"); q--; while (*q == ' ') { - *q-- = NULL; + *q-- = '\0'; } assert(strlen(buffer) < MAXLINE, "buffer length exceeded MAXLINE"); (void) strcpy(str, buffer); @@ -675,12 +673,12 @@ to_actual(void) static char buffer[MAXLINE+1]; int n; - *buffer = NULL; + *buffer = '\0'; if ((p = symtab_get_first_arg()) != NULL) { n = MAXLINE - snprintf(buffer, MAXLINE, "%s", name_of(p)); for (p = symtab_get_next_arg(); p != NULL; p = symtab_get_next_arg()) { - if (*name_of(p) != NULL) + if (*name_of(p) != '\0') n -= snprintf(strend(buffer), n, ", %s", name_of(p)); } @@ -698,7 +696,7 @@ strpqcpy(char *target, char *p, char *q) char saved; saved = *q; - *q = NULL; + *q = '\0'; (void) strcpy(target, p); *q = saved; return (target); diff --git a/usr/src/cmd/abi/spectrans/spec2trace/util.c b/usr/src/cmd/abi/spectrans/spec2trace/util.c index 55eb115f7a..549eba1f40 100644 --- a/usr/src/cmd/abi/spectrans/spec2trace/util.c +++ b/usr/src/cmd/abi/spectrans/spec2trace/util.c @@ -24,8 +24,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include <stdio.h> #include <string.h> #include <ctype.h> @@ -52,16 +50,16 @@ strnormalize(char *str) { char *p; - if (str == NULL || *str == NULL) + if (str == NULL || *str == '\0') return (str); - for (p = str; *p != NULL; p++) { + for (p = str; *p != '\0'; p++) { if (isspace(*p)) { *p = ' '; } } p--; while (p >= str && (isspace(*p) || *p == ';')) - *p-- = NULL; + *p-- = '\0'; /* ERA - remove leading spaces */ while (isspace(*str)) @@ -75,11 +73,11 @@ strtrim(char *str) { char *p; - for (p = str; *p != NULL; p++) + for (p = str; *p != '\0'; p++) continue; p--; while (p >= str && isspace(*p)) - *p-- = NULL; + *p-- = '\0'; return (str); } @@ -92,7 +90,7 @@ strlower(char *str) { char *p; - for (p = str; *p != NULL; p++) { + for (p = str; *p != '\0'; p++) { *p = tolower(*p); } return (str); @@ -144,7 +142,7 @@ in_string_set(char *p, char *set) break; } save = *q; - *q = NULL; + *q = '\0'; if (strcmp(p, set) == 0) { *q = save; errlog(VERBOSE, "return YES"); @@ -262,14 +260,14 @@ objectname(char *name) static char basename[MAXLINE]; p = strrchr(name, '/'); - while (p != NULL && *(p+1) == NULL) { + while (p != NULL && *(p+1) == '\0') { /* The / was at the end of the name. */ - *p = NULL; + *p = '\0'; p = strrchr(name, '/'); } (void) strlcpy(basename, p? p+1: name, MAXLINE); if ((p = strstr(basename, ".c")) != NULL) { - *p = NULL; + *p = '\0'; } return (strcat(basename, ".o")); } @@ -362,7 +360,7 @@ in_string_table(table_t *t, char *value) } for (i = 0; i <= t->used; i++) { if (strncmp(value, t->elements[i], len) == 0 && - (t->elements[i][len] == NULL || + (t->elements[i][len] == '\0' || t->elements[i][len] == ',')) return (1); } diff --git a/usr/src/cmd/acct/acctwtmp.c b/usr/src/cmd/acct/acctwtmp.c index ef80ecb189..948f485f52 100644 --- a/usr/src/cmd/acct/acctwtmp.c +++ b/usr/src/cmd/acct/acctwtmp.c @@ -20,13 +20,12 @@ * CDDL HEADER END */ /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ -/* All Rights Reserved */ +/* All Rights Reserved */ /* * Copyright 2005 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" /* * acctwtmp reason /var/adm/wtmpx * writes utmpx.h record (with current time) to specific file @@ -49,10 +48,10 @@ main(int argc, char **argv) if (argc < 3) (void) fprintf(stderr, "Usage: %s reason wtmpx_file\n", - argv[0]), exit(1); + argv[0]), exit(1); (void) strncpy(wb.ut_line, argv[1], sizeof (wb.ut_line)); - wb.ut_line[11] = NULL; + wb.ut_line[11] = '\0'; wb.ut_type = ACCOUNTING; time(&wb.ut_xtime); utmpxname(argv[2]); diff --git a/usr/src/cmd/allocate/allocate3.c b/usr/src/cmd/allocate/allocate3.c index 9da5745e0c..7c81ad0f46 100644 --- a/usr/src/cmd/allocate/allocate3.c +++ b/usr/src/cmd/allocate/allocate3.c @@ -812,13 +812,12 @@ mk_revoke(int optflag, char *file) continue; } (void) close(fp); - if (strcmp(info.pr_fname, "vold") == NULL) { + if (strcmp(info.pr_fname, "vold") == 0) { dprintf("%d matched vold name\n", fuserpid); continue; } - if (strcmp(info.pr_fname, "deallocate") - == NULL) { + if (strcmp(info.pr_fname, "deallocate") == 0) { dprintf("%d matched deallocate name\n", fuserpid); continue; @@ -1147,7 +1146,7 @@ out: int _allocate_dev(int optflag, uid_t uid, devalloc_t *da, char *zonename, - int *lock_fd) + int *lock_fd) { int i; int bytes = 0; @@ -1156,8 +1155,8 @@ _allocate_dev(int optflag, uid_t uid, devalloc_t *da, char *zonename, int dealloc_optflag = 0; char *fname = NULL; char file_name[MAXPATHLEN]; - devmap_t *dm; - struct stat stat_buf; + devmap_t *dm; + struct stat stat_buf; struct state_file sf; struct zone_path zpath; diff --git a/usr/src/cmd/allocate/mkdevalloc.c b/usr/src/cmd/allocate/mkdevalloc.c index 508f5961c4..d9dfaccbc9 100644 --- a/usr/src/cmd/allocate/mkdevalloc.c +++ b/usr/src/cmd/allocate/mkdevalloc.c @@ -319,7 +319,7 @@ dotape() while (dep = readdir(dirp)) { /* skip . .. etc... */ - if (strncmp(dep->d_name, ".", 1) == NULL) + if (strncmp(dep->d_name, ".", 1) == 0) continue; /* if array full, then expand it */ @@ -520,7 +520,7 @@ doaudio() while (dep = readdir(dirp)) { /* skip . .. etc... */ - if (strncmp(dep->d_name, ".", 1) == NULL) + if (strncmp(dep->d_name, ".", 1) == 0) continue; /* if array full, then expand it */ @@ -903,7 +903,7 @@ docd() while (dep = readdir(dirp)) { /* skip . .. etc... */ - if (strncmp(dep->d_name, ".", 1) == NULL) + if (strncmp(dep->d_name, ".", 1) == 0) continue; /* get device # (disk #) */ @@ -954,7 +954,7 @@ found: while (dep = readdir(dirp)) { /* skip . .. etc... */ - if (strncmp(dep->d_name, ".", 1) == NULL) + if (strncmp(dep->d_name, ".", 1) == 0) continue; /* get device # (disk #) */ @@ -1111,7 +1111,7 @@ dormdisk(int cd_count) checked = 0; removable = 0; /* skip . .. etc... */ - if (strncmp(dep->d_name, ".", 1) == NULL) + if (strncmp(dep->d_name, ".", 1) == 0) continue; /* get device # (disk #) */ diff --git a/usr/src/cmd/audio/audioplay/audioplay.c b/usr/src/cmd/audio/audioplay/audioplay.c index ad225bb55e..272b61f5ca 100644 --- a/usr/src/cmd/audio/audioplay/audioplay.c +++ b/usr/src/cmd/audio/audioplay/audioplay.c @@ -249,7 +249,8 @@ open_audio(void) /* Play a list of audio files. */ int -main(int argc, char **argv) { +main(int argc, char **argv) +{ int errorStatus = 0; int i; int c; @@ -511,8 +512,8 @@ main(int argc, char **argv) { /* Skip the file header and set the proper size */ cnt = lseek(ifd, 0, SEEK_CUR); if (cnt < 0) { - perror("lseek"); - exit(1); + perror("lseek"); + exit(1); } inbuf = (unsigned char *) mapaddr + cnt; len = cnt = st.st_size - cnt; @@ -730,8 +731,8 @@ main(int argc, char **argv) { demux(3, cnt / File_hdr.channels); for (c = 0; - c < File_hdr.channels; - c++) { + c < File_hdr.channels; + c++) { err = g723_decode( in_ch_data[c], cnt / @@ -920,8 +921,8 @@ parse_unsigned(char *str, unsigned *dst, char *flag) static int path_open(char *fname, int flags, mode_t mode, char *path) { - char fullpath[MAXPATHLEN]; /* full path of file */ - char *buf; /* malloc off the tmp buff */ + char fullpath[MAXPATHLEN]; /* full path of file */ + char *buf; /* malloc off the tmp buff */ char *cp; struct stat st; @@ -963,7 +964,7 @@ path_open(char *fname, int flags, mode_t mode, char *path) for (path = buf; path && *path; ) { if (cp = strchr(path, ':')) { - *cp++ = NULL; /* now pts to next path element */ + *cp++ = '\0'; /* now pts to next path element */ } /* the safest way to create the path string :-) */ diff --git a/usr/src/cmd/audio/audiorecord/audiorecord.c b/usr/src/cmd/audio/audiorecord/audiorecord.c index 6195ffe351..954c882e9b 100644 --- a/usr/src/cmd/audio/audiorecord/audiorecord.c +++ b/usr/src/cmd/audio/audiorecord/audiorecord.c @@ -73,7 +73,7 @@ static char *Stdout; /* XXX - the input buffer size should depend on sample_rate */ #define AUDIO_BUFSIZ (1024 * 64) static unsigned char buf[AUDIO_BUFSIZ]; -static char swapBuf[AUDIO_BUFSIZ]; /* for byte swapping */ +static char swapBuf[AUDIO_BUFSIZ]; /* for byte swapping */ #define MAX_GAIN (100) /* maximum gain */ @@ -183,7 +183,7 @@ main(int argc, char **argv) int err; int file_type; int ofd; - int swapBytes = FALSE; + int swapBytes = FALSE; double vol; struct stat st; struct pollfd pfd; @@ -774,7 +774,7 @@ parse_sample_rate(char *s, unsigned *rate) */ for (cp = s; *cp && (isdigit(*cp) || (*cp == '.')); cp++) /* NOP */; - if (*cp != NULL) { + if (*cp != '\0') { if ((*cp == 'k') || (*cp == 'K')) { drate *= 1000.0; } else if ((*cp != 'h') && (*cp != 'H')) { diff --git a/usr/src/cmd/backup/restore/utilities.c b/usr/src/cmd/backup/restore/utilities.c index 7cfa8b1ec4..db232c545d 100644 --- a/usr/src/cmd/backup/restore/utilities.c +++ b/usr/src/cmd/backup/restore/utilities.c @@ -114,7 +114,7 @@ renameit(char *fp, char *tp) tofd = fromfd; if ((pathend = strrchr(from, '/')) != NULL) { strncpy(tobuf, from, pathend - from + 1); - tobuf[pathend - from + 1] = NULL; + tobuf[pathend - from + 1] = '\0'; strlcat(tobuf, tp, sizeof (tobuf)); to = tobuf; } else { @@ -154,8 +154,8 @@ newnode(struct entry *np) if (fchdir(dfd) < 0) { int saverr = errno; (void) fprintf(stderr, - gettext("Warning: cannot create %s: %s"), - cp, strerror(saverr)); + gettext("Warning: cannot create %s: %s"), + cp, strerror(saverr)); (void) fflush(stderr); (void) close(dfd); return; @@ -200,8 +200,8 @@ removenode(struct entry *ep) if (fchdir(dfd) < 0) { int saverr = errno; (void) fprintf(stderr, - gettext("Warning: cannot remove %s: %s"), - cp, strerror(saverr)); + gettext("Warning: cannot remove %s: %s"), + cp, strerror(saverr)); (void) fflush(stderr); (void) close(dfd); return; @@ -210,7 +210,7 @@ removenode(struct entry *ep) if (rmdir(cp) < 0) { /* NOTE: could use unlinkat (..,REMOVEDIR) */ int saverr = errno; (void) fprintf(stderr, gettext("Warning: %s: %s\n"), - cp, strerror(saverr)); + cp, strerror(saverr)); (void) fflush(stderr); } else { vprintf(stdout, gettext("Remove node %s\n"), cp); @@ -240,7 +240,7 @@ removeleaf(struct entry *ep) if (unlinkat(dfd, cp, 0) < 0) { int saverr = errno; (void) fprintf(stderr, gettext("Warning: %s: %s\n"), - cp, strerror(saverr)); + cp, strerror(saverr)); (void) fflush(stderr); } else { vprintf(stdout, gettext("Remove leaf %s\n"), cp); @@ -266,8 +266,8 @@ lf_linkit(char *existing, char *new, int type) resolve(existing, &dfd, &name); if (dfd == -1) { (void) fprintf(stderr, gettext( - "Warning: cannot restore %s link %s->%s\n"), - (type == SYMLINK ? "symbolic" : "hard"), new, existing); + "Warning: cannot restore %s link %s->%s\n"), + (type == SYMLINK ? "symbolic" : "hard"), new, existing); result = FAIL; goto out; } @@ -380,7 +380,7 @@ badentry(struct entry *ep, char *msg) (void) fprintf(stderr, gettext("bad entry: %s\n"), msg); (void) fprintf(stderr, gettext("name: %s\n"), myname(ep)); (void) fprintf(stderr, gettext("parent name %s\n"), - myname(ep->e_parent)); + myname(ep->e_parent)); if (ep->e_sibling != NIL) (void) fprintf(stderr, gettext("sibling name: %s\n"), myname(ep->e_sibling)); @@ -429,7 +429,7 @@ flagvalues(struct entry *ep) (void) strlcat(flagbuf, gettext("|XATTR"), sizeof (flagbuf)); if (ep->e_flags & XATTRROOT) (void) strlcat(flagbuf, gettext("|XATTRROOT"), - sizeof (flagbuf)); + sizeof (flagbuf)); return (&flagbuf[1]); } @@ -463,7 +463,7 @@ reply(char *question) while (c != '\n' && getc(terminal) != '\n') { if (ferror(terminal)) { (void) fprintf(stderr, gettext( - "Error reading response\n")); + "Error reading response\n")); (void) fflush(stderr); return (FAIL); } @@ -521,6 +521,7 @@ panic(va_dcl) abort(); done(1); } +} #endif /* @@ -602,7 +603,7 @@ safe_open(int dfd, const char *filename, int mode, int perms) O_WRONLY|O_CREAT|O_TRUNC|O_EXCL|O_LARGEFILE, perms)) < 0) { if (errno == EEXIST) { if (fstatat(dfd, filename, &pre_lstat, - AT_SYMLINK_NOFOLLOW) < 0) { + AT_SYMLINK_NOFOLLOW) < 0) { saverr = errno; (void) close(fd); errno = saverr; @@ -632,7 +633,7 @@ safe_open(int dfd, const char *filename, int mode, int perms) } if (fstatat(fd, NULL, &post_lstat, - AT_SYMLINK_NOFOLLOW) < 0) { + AT_SYMLINK_NOFOLLOW) < 0) { saverr = errno; (void) close(fd); errno = saverr; @@ -793,10 +794,10 @@ mkentry(char *name, ino_t ino, struct arglist *ap) if (ap->base == NULL) { ap->nent = 20; ap->base = (struct afile *)calloc((unsigned)ap->nent, - sizeof (*(ap->base))); + sizeof (*(ap->base))); if (ap->base == NULL) { (void) fprintf(stderr, - gettext("%s: out of memory\n"), ap->cmd); + gettext("%s: out of memory\n"), ap->cmd); return (FAIL); } } @@ -811,7 +812,7 @@ mkentry(char *name, ino_t ino, struct arglist *ap) (size_t)(2 * ap->nent * (size_t)sizeof (*(ap->base)))); if (ap->base == NULL) { (void) fprintf(stderr, - gettext("%s: out of memory\n"), ap->cmd); + gettext("%s: out of memory\n"), ap->cmd); return (FAIL); } ap->head = ap->base; @@ -860,7 +861,7 @@ expand(char *as, int rflg, struct arglist *ap) char slash; char *rs; char c; - wchar_t w_fname[PATH_MAX+1]; + wchar_t w_fname[PATH_MAX+1]; wchar_t w_pname[PATH_MAX+1]; /* @@ -1102,8 +1103,9 @@ resolve(char *path, int *fd, char **rpath) *rpath = path; path = *rpath + strlen(*rpath) +1; while (*path != '\0' && - (*fd = openat64(tfd, *rpath, O_RDONLY)) > 0) { - if (tfd != AT_FDCWD) (void) close(tfd); + (*fd = openat64(tfd, *rpath, O_RDONLY)) > 0) { + if (tfd != AT_FDCWD) + (void) close(tfd); tfd = *fd; *rpath = path; path = *rpath + strlen(*rpath) +1; @@ -1113,8 +1115,8 @@ resolve(char *path, int *fd, char **rpath) if (*fd < 0 || (*fd = openat64(tfd, ".", O_RDONLY|O_XATTR)) < 0) { int saverr = errno; (void) fprintf(stderr, - gettext("Warning: cannot fully resolve %s: %s"), - path, strerror(saverr)); + gettext("Warning: cannot fully resolve %s: %s"), + path, strerror(saverr)); (void) fflush(stderr); } if (tfd != AT_FDCWD) (void) close(tfd); @@ -1146,6 +1148,6 @@ complexcpy(char *s1, char *s2, int max) if (nullseen == 0) *--s1 = '\0'; fprintf(stderr, - gettext("Warning: unterminated source string in complexcpy\n")); + gettext("Warning: unterminated source string in complexcpy\n")); return (max-1); } diff --git a/usr/src/cmd/bart/compare.c b/usr/src/cmd/bart/compare.c index 254d4507eb..f92b23944e 100644 --- a/usr/src/cmd/bart/compare.c +++ b/usr/src/cmd/bart/compare.c @@ -23,7 +23,6 @@ * Copyright 2003 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" #include <unistd.h> #include "bart.h" @@ -52,7 +51,7 @@ bart_compare(int argc, char **argv) char *control_fname, *test_fname; int c; FILE *rules_fd = NULL; - uint_t glob_flags; + uint_t glob_flags; boolean_t prog_fmt = B_FALSE; init_default_flags(&glob_flags); @@ -100,13 +99,13 @@ bart_compare(int argc, char **argv) static int compare_manifests(FILE *rulesfile, char *control, char *test, -boolean_t prog_fmt, uint_t flags) + boolean_t prog_fmt, uint_t flags) { FILE *control_fd, *test_fd; char *control_line, *test_line, control_buf[BUF_SIZE], - test_buf[BUF_SIZE], control_fname[PATH_MAX], - control_type[TYPE_SIZE], test_fname[PATH_MAX], - test_type[TYPE_SIZE]; + test_buf[BUF_SIZE], control_fname[PATH_MAX], + control_type[TYPE_SIZE], test_fname[PATH_MAX], + test_type[TYPE_SIZE]; int control_pos, test_pos, ret, fname_cmp, return_status; return_status = EXIT; @@ -227,8 +226,8 @@ boolean_t prog_fmt, uint_t flags) static void parse_line(char *line, char *fname, char *type, char *size, char *mode, -char *acl, char *mtime, char *uid, char *gid, char *contents, char *devnode, -char *dest) + char *acl, char *mtime, char *uid, char *gid, char *contents, char *devnode, + char *dest) { int pos, line_len; @@ -246,7 +245,7 @@ char *dest) /* Reset these fields... */ - *contents = NULL; + *contents = '\0'; *devnode = '\0'; *dest = '\0'; @@ -341,17 +340,17 @@ evaluate_differences(char *control_line, char *test_line, boolean_t prog_fmt, int flags) { char ctrl_fname[PATH_MAX], test_fname[PATH_MAX], - ctrl_type[TYPE_SIZE], test_type[TYPE_SIZE], - ctrl_size[MISC_SIZE], ctrl_mode[MISC_SIZE], - ctrl_acl[ACL_SIZE], ctrl_mtime[MISC_SIZE], - ctrl_uid[MISC_SIZE], ctrl_gid[MISC_SIZE], - ctrl_dest[PATH_MAX], ctrl_contents[PATH_MAX], - ctrl_devnode[PATH_MAX], test_size[MISC_SIZE], - test_mode[MISC_SIZE], test_acl[ACL_SIZE], - test_mtime[MISC_SIZE], test_uid[MISC_SIZE], - test_gid[MISC_SIZE], test_dest[PATH_MAX], - test_contents[PATH_MAX], test_devnode[PATH_MAX], - *tag; + ctrl_type[TYPE_SIZE], test_type[TYPE_SIZE], + ctrl_size[MISC_SIZE], ctrl_mode[MISC_SIZE], + ctrl_acl[ACL_SIZE], ctrl_mtime[MISC_SIZE], + ctrl_uid[MISC_SIZE], ctrl_gid[MISC_SIZE], + ctrl_dest[PATH_MAX], ctrl_contents[PATH_MAX], + ctrl_devnode[PATH_MAX], test_size[MISC_SIZE], + test_mode[MISC_SIZE], test_acl[ACL_SIZE], + test_mtime[MISC_SIZE], test_uid[MISC_SIZE], + test_gid[MISC_SIZE], test_dest[PATH_MAX], + test_contents[PATH_MAX], test_devnode[PATH_MAX], + *tag; int ret_val; struct rule *rule_ptr; diff --git a/usr/src/cmd/bnu/getprm.c b/usr/src/cmd/bnu/getprm.c index 5169e7950e..dd5dea00ce 100644 --- a/usr/src/cmd/bnu/getprm.c +++ b/usr/src/cmd/bnu/getprm.c @@ -28,8 +28,6 @@ /* All Rights Reserved */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include "uucp.h" #define LQUOTE '(' @@ -235,7 +233,7 @@ char *arg, *sys, *fwd, *file; if (cl != (cr = wcsrchr(n, (wchar_t)'!'))) { /* more than one ! */ wcsncpy(tmpbuf, cl+1, cr-cl-1); - tmpbuf[cr-cl-1] = NULL; + tmpbuf[cr-cl-1] = '\0'; (void) wcstombs(fwd, tmpbuf, MAXFULLNAME); } } else { diff --git a/usr/src/cmd/bnu/gio.c b/usr/src/cmd/bnu/gio.c index c09bfdca36..a6b0dbb5fd 100644 --- a/usr/src/cmd/bnu/gio.c +++ b/usr/src/cmd/bnu/gio.c @@ -28,8 +28,6 @@ /* All Rights Reserved */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include "uucp.h" #include "pk.h" @@ -72,7 +70,7 @@ gturnon() if (Debug > 4) pkdebug = 1; Pk = pkopen(Ifn, Ofn); - if ((int) Pk == NULL) + if (Pk == NULL) return(FAIL); return(0); } diff --git a/usr/src/cmd/bnu/interface.c b/usr/src/cmd/bnu/interface.c index ba1c9f9381..2f8c9578cc 100644 --- a/usr/src/cmd/bnu/interface.c +++ b/usr/src/cmd/bnu/interface.c @@ -302,19 +302,19 @@ unsigned nbytes; } if (info.tsdu <= 0 || nbytes <= info.tsdu) - return (t_snd(fd, buf, nbytes, NULL)); + return (t_snd(fd, buf, nbytes, 0)); /* if get here, then there is a limit on transmit size */ /* (info.tsdu > 0) and buf exceeds it */ i = ret = 0; while (nbytes >= info.tsdu) { - if ((ret = t_snd(fd, &buf[i], info.tsdu, NULL)) != info.tsdu) + if ((ret = t_snd(fd, &buf[i], info.tsdu, 0)) != info.tsdu) return ((ret >= 0 ? (i + ret) : ret)); i += info.tsdu; nbytes -= info.tsdu; } if (nbytes != 0) { - if ((ret = t_snd(fd, &buf[i], nbytes, NULL)) != nbytes) + if ((ret = t_snd(fd, &buf[i], nbytes, 0)) != nbytes) return ((ssize_t)(ret >= 0 ? (i + ret) : ret)); i += nbytes; } diff --git a/usr/src/cmd/bnu/sysfiles.c b/usr/src/cmd/bnu/sysfiles.c index db147774d0..959e0c9e56 100644 --- a/usr/src/cmd/bnu/sysfiles.c +++ b/usr/src/cmd/bnu/sysfiles.c @@ -480,7 +480,7 @@ char *buf; ASSERT(len >= BUFSIZ, "BUFFER TOO SMALL", "getsysline", 0); for(;;) { - while (getaline(fsystems, buf) != NULL) + while (getaline(fsystems, buf) != 0) if ((*buf != '#') && (*buf != ' ') && (*buf != '\t') && (*buf != '\n')) { (void) _uu_resetlocale(LC_ALL, prev); diff --git a/usr/src/cmd/bnu/uudecode.c b/usr/src/cmd/bnu/uudecode.c index 5af8d3ac55..eb90dc6a77 100644 --- a/usr/src/cmd/bnu/uudecode.c +++ b/usr/src/cmd/bnu/uudecode.c @@ -25,8 +25,6 @@ /* Copyright 2004 Sun Microsystems, Inc. All rights reserved. */ /* Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - /* * uudecode [-o outfile | -p] [input] * @@ -356,7 +354,7 @@ decode(FILE *in, FILE *out, int base64) while ((fgets(inbuf, sizeof (inbuf), in)) != NULL) { /* process an input line */ iptr = inbuf; - while ((curchr = *(iptr++)) != NULL) { + while ((curchr = *(iptr++)) != '\0') { /* decode chars */ if (curchr == '=') /* if end */ endseen++; diff --git a/usr/src/cmd/bnu/uustat.c b/usr/src/cmd/bnu/uustat.c index 992f68c5da..78cbf945a5 100644 --- a/usr/src/cmd/bnu/uustat.c +++ b/usr/src/cmd/bnu/uustat.c @@ -447,7 +447,7 @@ char **envp; /* Make sure the overflow entry is null since it may be incorrect */ M[UUSTAT_TBL].mach[0] = NULLCHAR; if (Summary) { - for((sortcnt = 0, m = &M[0]);*(m->mach) != NULL;(sortcnt++,m++)) + for((sortcnt = 0, m = &M[0]);*(m->mach) != '\0';(sortcnt++,m++)) ; qsort((char *)M, (unsigned int)sortcnt, sizeof(struct m), machcmp); for (m = M; m->mach[0] != NULLCHAR; m++) diff --git a/usr/src/cmd/boot/bootadm/bootadm.c b/usr/src/cmd/boot/bootadm/bootadm.c index f0de13c1ed..62cbd6ef8c 100644 --- a/usr/src/cmd/boot/bootadm/bootadm.c +++ b/usr/src/cmd/boot/bootadm/bootadm.c @@ -1034,13 +1034,13 @@ list_setting(menu_t *mp, char *which, char *setting) assert(which); assert(setting); - if (*which != NULL) { + if (*which != '\0') { /* * If "which" is not a number, assume it's a setting we want * to look for and so set up the routine to look for "which" * in the default entry. */ - while (*p != NULL) + while (*p != '\0') if (!(isdigit((int)*p++))) { setting = which; which = mp->curdefault->arg; @@ -1061,10 +1061,10 @@ list_setting(menu_t *mp, char *which, char *setting) return (BAM_ERROR); } - found = (*setting == NULL); + found = (*setting == '\0'); for (lp = ent->start; lp != NULL; lp = lp->next) { - if ((*setting == NULL) && (lp->flags != BAM_COMMENT)) + if ((*setting == '\0') && (lp->flags != BAM_COMMENT)) bam_print("%s\n", lp->line); else if (lp->cmd != NULL && strcmp(setting, lp->cmd) == 0) { bam_print("%s\n", lp->arg); diff --git a/usr/src/cmd/boot/bootadm/bootadm_hyper.c b/usr/src/cmd/boot/bootadm/bootadm_hyper.c index 66e0051eae..f88960383e 100644 --- a/usr/src/cmd/boot/bootadm/bootadm_hyper.c +++ b/usr/src/cmd/boot/bootadm/bootadm_hyper.c @@ -35,8 +35,8 @@ #include "bootadm.h" -#define HYPER_KERNEL_DIR "/platform/i86xpv/kernel" -#define METAL_KERNEL_DIR "/platform/i86pc/kernel" +#define HYPER_KERNEL_DIR "/platform/i86xpv/kernel" +#define METAL_KERNEL_DIR "/platform/i86pc/kernel" #define BOOTRC_FILE "/boot/solaris/bootenv.rc" #define ZFS_BOOTSTR "$ZFS-BOOTFS" @@ -72,7 +72,7 @@ append_str(char *orig, char *str, char *delim) if ((str == NULL) || (delim == NULL)) return (NULL); - if ((orig == NULL) || (*orig == NULL)) { + if ((orig == NULL) || (*orig == '\0')) { /* * Return a pointer to a copy of the path so a caller can * always rely upon being able to free() a returned pointer. @@ -147,26 +147,26 @@ get_token(char **token, char *str, char *delim) *token = NULL; - if ((str == NULL) || (*str == NULL)) + if ((str == NULL) || (*str == '\0')) return (NULL); do { if ((*str == '\'') || (*str == '"')) { char quote = *str++; - while ((*str != NULL) && (*str != quote)) + while ((*str != '\0') && (*str != quote)) str++; /* no matching quote found in string */ - if (*str++ == NULL) + if (*str++ == '\0') return (NULL); } /* look for a character from the delimiter string */ - for (dp = delim; ((*dp != NULL) && (*dp != *str)); dp++) + for (dp = delim; ((*dp != '\0') && (*dp != *str)); dp++) ; - if (*dp != NULL) { + if (*dp != '\0') { len = str - start + 1; /* found a delimiter, so create a token string */ @@ -183,7 +183,7 @@ get_token(char **token, char *str, char *delim) return (str); } - } while (*str++ != NULL); + } while (*str++ != '\0'); /* if we hit the end of the string, the token is the whole string */ *token = s_strdup(start); @@ -338,7 +338,7 @@ cvt_metal_option(char *optstr) namlen = value - optstr; - if (*++value == NULL) + if (*++value == '\0') return (1); if (strncmp(optstr, "console", namlen) == 0) { @@ -395,7 +395,7 @@ cvt_hyper_option(char *optstr) namlen = value - optstr; - if (*++value == NULL) + if (*++value == '\0') return (1); /* @@ -681,7 +681,7 @@ parse_bootenvrc(char *osroot) int port = 0; /* we're only interested in parsing "setprop" directives. */ - if (strncmp(line, "setprop", 7) != NULL) + if (strncmp(line, "setprop", 7) != 0) continue; /* eat initial "setprop" */ @@ -913,7 +913,7 @@ cvt_to_hyper(menu_t *mp, char *osroot, char *extra_args) } } - if ((extra_args != NULL) && (*extra_args != NULL)) { + if ((extra_args != NULL) && (*extra_args != '\0')) { newstr = append_str(kern_bargs, extra_args, " "); free(kern_bargs); kern_bargs = newstr; @@ -925,7 +925,7 @@ cvt_to_hyper(menu_t *mp, char *osroot, char *extra_args) kernel = alloca(len); if (kern_bargs != NULL) { - if (*kern_bargs != NULL) + if (*kern_bargs != '\0') (void) snprintf(kernel, len, "%s%s %s", osroot, XEN_MENU, kern_bargs); @@ -1003,7 +1003,7 @@ abort: if (ret != BAM_NOCHANGE) bam_error(_("error converting GRUB menu entry on %s for use " "with the hypervisor.\nAborting.\n"), - ((*osroot == NULL) ? "/" : osroot)); + ((*osroot == '\0') ? "/" : osroot)); return (ret); } diff --git a/usr/src/cmd/cfgadm/cfgadm.c b/usr/src/cmd/cfgadm/cfgadm.c index 1ef642871d..fd660c7298 100644 --- a/usr/src/cmd/cfgadm/cfgadm.c +++ b/usr/src/cmd/cfgadm/cfgadm.c @@ -201,7 +201,7 @@ main( char *subopts; char *subvalue; char *const *ap_args = NULL; - cfga_cmd_t sc_opt = NULL; + cfga_cmd_t sc_opt = 0; struct cfga_confirm confirm; struct cfga_msg message; int ret = CFGA_ERROR; diff --git a/usr/src/cmd/chmod/chmod.c b/usr/src/cmd/chmod/chmod.c index 8e9b1ecbbe..897b5d8d20 100644 --- a/usr/src/cmd/chmod/chmod.c +++ b/usr/src/cmd/chmod/chmod.c @@ -553,7 +553,7 @@ parseargs(int ac, char *av[]) /* process the arguments */ for (i = mac = 0; - (av[i] != (char *)NULL) && (av[i][0] != (char)NULL); + (av[i] != NULL) && (av[i][0] != '\0'); i++) { if (!fflag && av[i][0] == '-') { /* diff --git a/usr/src/cmd/cmd-inet/sbin/ifparse/ifparse.c b/usr/src/cmd/cmd-inet/sbin/ifparse/ifparse.c index d73722cc55..caf7987fc7 100644 --- a/usr/src/cmd/cmd-inet/sbin/ifparse/ifparse.c +++ b/usr/src/cmd/cmd-inet/sbin/ifparse/ifparse.c @@ -435,7 +435,7 @@ ifparse(int argc, char *argv[], struct afswtch *afp) return (0); if (strcmp(*argv, "auto-dhcp") == 0 || strcmp(*argv, "dhcp") == 0) { - if ((parsemode & PARSEFIXED) != NULL) { + if ((parsemode & PARSEFIXED) != 0) { while (argc) { (void) fputs(*argv++, stdout); if (--argc != 0) diff --git a/usr/src/cmd/cmd-inet/usr.bin/ftp/ftp.c b/usr/src/cmd/cmd-inet/usr.bin/ftp/ftp.c index f92dcc6759..f7007286a8 100644 --- a/usr/src/cmd/cmd-inet/usr.bin/ftp/ftp.c +++ b/usr/src/cmd/cmd-inet/usr.bin/ftp/ftp.c @@ -37,8 +37,6 @@ * contributors. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include "ftp_var.h" #include <arpa/nameser.h> #include <sys/types.h> @@ -1524,7 +1522,7 @@ initconn(void) "parsing failure.\n"); goto bad; } - *(c2 - 1) = NULL; + *(c2 - 1) = '\0'; /* Delimiter is the next char in the reply string */ delm = *(++c); while (*c == delm) { diff --git a/usr/src/cmd/cmd-inet/usr.bin/netstat/netstat.c b/usr/src/cmd/cmd-inet/usr.bin/netstat/netstat.c index 475e915b2e..223e582072 100644 --- a/usr/src/cmd/cmd-inet/usr.bin/netstat/netstat.c +++ b/usr/src/cmd/cmd-inet/usr.bin/netstat/netstat.c @@ -3517,7 +3517,7 @@ dhcp_walk_interfaces(int af, boolean_t printed_one) if (ioctl(sock_fd, SIOCGLIFCONF, &lifc) == -1) { (void) close(sock_fd); free(lifc.lifc_buf); - return (NULL); + return (B_FALSE); } n_ifs = lifc.lifc_len / sizeof (struct lifreq); diff --git a/usr/src/cmd/cmd-inet/usr.bin/netstat/unix.c b/usr/src/cmd/cmd-inet/usr.bin/netstat/unix.c index 175310a9a6..1a6364c00f 100644 --- a/usr/src/cmd/cmd-inet/usr.bin/netstat/unix.c +++ b/usr/src/cmd/cmd-inet/usr.bin/netstat/unix.c @@ -235,7 +235,7 @@ nextstr(char *pas) { char *next; - for (next = &pas[strlen(pas) + 1]; *next == NULL; ) { + for (next = &pas[strlen(pas) + 1]; *next == '\0'; ) { next++; } diff --git a/usr/src/cmd/cmd-inet/usr.bin/telnet/enc_des.c b/usr/src/cmd/cmd-inet/usr.bin/telnet/enc_des.c index aa4621d53c..cafcbebb13 100644 --- a/usr/src/cmd/cmd-inet/usr.bin/telnet/enc_des.c +++ b/usr/src/cmd/cmd-inet/usr.bin/telnet/enc_des.c @@ -3,8 +3,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - /* * usr/src/cmd/cmd-inet/usr.bin/telnet/enc_des.c */ @@ -126,7 +124,7 @@ ecb_encrypt(struct stinfo *stp, Block in, Block out) /* this is a kerberos enctype, not a telopt enctype */ dout.enctype = ENCTYPE_UNKNOWN; - code = krb5_c_encrypt(telnet_context, &stp->str_key, NULL, NULL, + code = krb5_c_encrypt(telnet_context, &stp->str_key, 0, NULL, &din, &dout); if (code) (void) fprintf(stderr, gettext( diff --git a/usr/src/cmd/cmd-inet/usr.bin/telnet/encrypt.c b/usr/src/cmd/cmd-inet/usr.bin/telnet/encrypt.c index 05d6127211..02bd4a08fa 100644 --- a/usr/src/cmd/cmd-inet/usr.bin/telnet/encrypt.c +++ b/usr/src/cmd/cmd-inet/usr.bin/telnet/encrypt.c @@ -3,8 +3,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - /* * usr/src/cmd/cmd-inet/usr.bin/telnet/encrypt.c */ @@ -142,7 +140,7 @@ findencryption(int type) if (!(I_SUPPORT_ENCRYPT & remote_supports_decrypt & typemask(type))) return (NULL); - for (; (ep->type != NULL) && (ep->type != type); ep++); + for (; (ep->type != 0) && (ep->type != type); ep++); return (ep->type ? ep : NULL); } diff --git a/usr/src/cmd/cmd-inet/usr.bin/telnet/kerberos5.c b/usr/src/cmd/cmd-inet/usr.bin/telnet/kerberos5.c index ea62472061..b4a5c41074 100644 --- a/usr/src/cmd/cmd-inet/usr.bin/telnet/kerberos5.c +++ b/usr/src/cmd/cmd-inet/usr.bin/telnet/kerberos5.c @@ -3,8 +3,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - /* * usr/src/cmd/cmd-inet/usr.bin/telnet/kerberos5.c * @@ -255,7 +253,7 @@ kerberos5_send(Authenticator *ap) } if ((retval = krb5_cc_get_principal(telnet_context, ccache, - &creds.client)) != NULL) { + &creds.client)) != 0) { if (auth_debug_mode) { (void) printf(gettext( "telnet: Kerberos V5: failure on principal " @@ -378,7 +376,7 @@ kerberos5_send(Authenticator *ap) } if ((auth_sendname((uchar_t *)UserNameRequested, - strlen(UserNameRequested))) == NULL) { + strlen(UserNameRequested))) == 0) { if (auth_debug_mode) (void) printf(gettext( "telnet: Not enough room for user name\r\n")); diff --git a/usr/src/cmd/cmd-inet/usr.bin/telnet/telnet.c b/usr/src/cmd/cmd-inet/usr.bin/telnet/telnet.c index 9c0cac01c7..9bfbdf832f 100644 --- a/usr/src/cmd/cmd-inet/usr.bin/telnet/telnet.c +++ b/usr/src/cmd/cmd-inet/usr.bin/telnet/telnet.c @@ -3,8 +3,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - /* * Copyright (c) 1988, 1990, 1993 * The Regents of the University of California. All rights reserved. @@ -662,7 +660,7 @@ mklist(buf, name) *argv = 0; argvp = argv+1; n = 0; - for (cp = cp2 = buf; (c = *cp) != NULL; cp++) { + for (cp = cp2 = buf; (c = *cp) != '\0'; cp++) { if (c == '|' || c == ':') { *cp++ = '\0'; /* @@ -1673,7 +1671,7 @@ env_opt_add(ep) else *opt_replyp++ = ENV_USERVAR; for (;;) { - while ((c = *ep++) != NULL) { + while ((c = *ep++) != '\0') { switch (c&0xff) { case IAC: *opt_replyp++ = IAC; diff --git a/usr/src/cmd/cmd-inet/usr.lib/ilbd/ilbd_rules.c b/usr/src/cmd/cmd-inet/usr.lib/ilbd/ilbd_rules.c index 63adcf3dd9..538d1ea09b 100644 --- a/usr/src/cmd/cmd-inet/usr.lib/ilbd/ilbd_rules.c +++ b/usr/src/cmd/cmd-inet/usr.lib/ilbd/ilbd_rules.c @@ -1094,7 +1094,7 @@ ilbd_ip_to_str(uint16_t ipversion, struct in6_addr *addr, char *valstr) IP_COPY_IMPL_2_CLI(addr, &ipaddr); addrptr = (ipversion == AF_INET) ? (void *)&ipaddr.ia_v4 : (void *)&ipaddr.ia_v6; - if (inet_ntop(ipversion, (void *)addrptr, valstr, vallen == NULL)) + if (inet_ntop(ipversion, (void *)addrptr, valstr, vallen) == NULL) logerr("ilbd_ip_to_str: inet_ntop failed"); return; diff --git a/usr/src/cmd/cmd-inet/usr.lib/ilbd/ilbd_scf.c b/usr/src/cmd/cmd-inet/usr.lib/ilbd/ilbd_scf.c index 290a7b2cb6..b1e9bc911c 100644 --- a/usr/src/cmd/cmd-inet/usr.lib/ilbd/ilbd_scf.c +++ b/usr/src/cmd/cmd-inet/usr.lib/ilbd/ilbd_scf.c @@ -419,7 +419,7 @@ ilbd_get_svr_field(char *valstr, struct in6_addr *sgs_addr, ip_ver = atoi(ipverstr); addrptr = (ip_ver == AF_INET) ? (void *)&temp_ip.ia_v4 : (void *)&temp_ip.ia_v6; - if (inet_pton(ip_ver, ipaddr, addrptr) == NULL) { + if (inet_pton(ip_ver, ipaddr, addrptr) == 0) { logerr("ilbd_get_svr_field: inet_pton failed"); return; } diff --git a/usr/src/cmd/cmd-inet/usr.lib/inetd/config.c b/usr/src/cmd/cmd-inet/usr.lib/inetd/config.c index 1d84b01853..d183eb5961 100644 --- a/usr/src/cmd/cmd-inet/usr.lib/inetd/config.c +++ b/usr/src/cmd/cmd-inet/usr.lib/inetd/config.c @@ -48,9 +48,9 @@ /* supported method properties and their attributes */ static inetd_prop_t method_props[] = { -{PR_EXEC_NAME, "", INET_TYPE_STRING, B_FALSE, IVE_UNSET, NULL, B_FALSE}, -{PR_ARG0_NAME, "", INET_TYPE_STRING, B_TRUE, IVE_UNSET, NULL, B_FALSE}, -{SCF_PROPERTY_TIMEOUT, "", INET_TYPE_COUNT, B_TRUE, IVE_UNSET, NULL, B_FALSE}, +{PR_EXEC_NAME, "", INET_TYPE_STRING, B_FALSE, IVE_UNSET, 0, B_FALSE}, +{PR_ARG0_NAME, "", INET_TYPE_STRING, B_TRUE, IVE_UNSET, 0, B_FALSE}, +{SCF_PROPERTY_TIMEOUT, "", INET_TYPE_COUNT, B_TRUE, IVE_UNSET, 0, B_FALSE}, {NULL}, }; diff --git a/usr/src/cmd/cmd-inet/usr.sbin/hostconfig.c b/usr/src/cmd/cmd-inet/usr.sbin/hostconfig.c index 92eb0c81bb..8c6f7d25c2 100644 --- a/usr/src/cmd/cmd-inet/usr.sbin/hostconfig.c +++ b/usr/src/cmd/cmd-inet/usr.sbin/hostconfig.c @@ -24,8 +24,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include <stdio.h> #include <stdlib.h> #include <unistd.h> @@ -312,9 +310,7 @@ add_default_route(router_addr) int -bpanswer(res, nb) - struct bp_whoami_res *res; - struct netbuf *nb; +bpanswer(struct bp_whoami_res *res, struct netbuf *nb) { struct in_addr router_addr; static int set; @@ -379,7 +375,7 @@ bpanswer(res, nb) } if (multiple) - return (NULL); + return (0); /* our job is done */ exit(0); diff --git a/usr/src/cmd/cmd-inet/usr.sbin/ilbadm/ilbadm_subr.c b/usr/src/cmd/cmd-inet/usr.sbin/ilbadm/ilbadm_subr.c index 201023cea9..c69c3c8e89 100644 --- a/usr/src/cmd/cmd-inet/usr.sbin/ilbadm/ilbadm_subr.c +++ b/usr/src/cmd/cmd-inet/usr.sbin/ilbadm/ilbadm_subr.c @@ -54,14 +54,14 @@ ilbadm_val_type_t algo_types[] = { {(int)ILB_ALG_HASH_IP, "hash-ip", "hip"}, {(int)ILB_ALG_HASH_IP_SPORT, "hash-ip-port", "hipp"}, {(int)ILB_ALG_HASH_IP_VIP, "hash-ip-vip", "hipv"}, - {ILBD_BAD_VAL, NULL, NULL} + {ILBD_BAD_VAL, 0, 0} }; ilbadm_val_type_t topo_types[] = { {(int)ILB_TOPO_DSR, "DSR", "d"}, {(int)ILB_TOPO_NAT, "NAT", "n"}, {(int)ILB_TOPO_HALF_NAT, "HALF-NAT", "h"}, - {ILBD_BAD_VAL, NULL, NULL} + {ILBD_BAD_VAL, 0, 0} }; void @@ -916,7 +916,7 @@ i_store_val(char *val, void *store, ilbadm_key_code_t keyword) rc = ILBADM_INVAL_SYNTAX; break; } - *close = NULL; + *close = '\0'; } rc = i_match_onehost(val, vip, &at); /* re-assemble string as we found it */ diff --git a/usr/src/cmd/cmd-inet/usr.sbin/in.rarpd.c b/usr/src/cmd/cmd-inet/usr.sbin/in.rarpd.c index 81039c3e86..6907abc8d4 100644 --- a/usr/src/cmd/cmd-inet/usr.sbin/in.rarpd.c +++ b/usr/src/cmd/cmd-inet/usr.sbin/in.rarpd.c @@ -271,7 +271,7 @@ main(int argc, char *argv[]) /* * Start delayed processing thread. */ - (void) thr_create(NULL, NULL, (void *(*)(void *))do_delay_write, NULL, + (void) thr_create(NULL, 0, (void *(*)(void *))do_delay_write, NULL, THR_NEW_LWP, NULL); /* @@ -279,7 +279,7 @@ main(int argc, char *argv[]) */ for (rdev = rarpdev_head; rdev != NULL; rdev = rdev->next) { if (rdev->dh_rarp != NULL) { - (void) thr_create(NULL, NULL, + (void) thr_create(NULL, 0, (void *(*)(void *))do_rarp, (void *)rdev, THR_NEW_LWP, NULL); } diff --git a/usr/src/cmd/cmd-inet/usr.sbin/in.telnetd.c b/usr/src/cmd/cmd-inet/usr.sbin/in.telnetd.c index 181e6cbabe..afeb5a5c55 100644 --- a/usr/src/cmd/cmd-inet/usr.sbin/in.telnetd.c +++ b/usr/src/cmd/cmd-inet/usr.sbin/in.telnetd.c @@ -922,7 +922,7 @@ auth_is(uchar_t *data, int cnt) return; } - while (aptr->AuthName != NULL && + while (aptr->AuthName != 0 && (aptr->AuthName != data[0] || aptr->AuthHow != data[1])) aptr++; @@ -1117,7 +1117,7 @@ encrypt_is(uchar_t *data, int cnt) break; default: iv_status = CFB64_IV_BAD; - encr_data.decrypt.type = NULL; + encr_data.decrypt.type = 0; if (enc_debug) (void) fprintf(stderr, "\t(encrypt_is) Can't find type (%d) " diff --git a/usr/src/cmd/cmd-inet/usr.sbin/inetadm/inetadm.c b/usr/src/cmd/cmd-inet/usr.sbin/inetadm/inetadm.c index 66ecf99d37..d8e7c0878f 100644 --- a/usr/src/cmd/cmd-inet/usr.sbin/inetadm/inetadm.c +++ b/usr/src/cmd/cmd-inet/usr.sbin/inetadm/inetadm.c @@ -810,8 +810,8 @@ modify_inst_props_cb(void *data, scf_walkinfo_t *wip) switch (mod[j].ip_type) { case INET_TYPE_INTEGER: - if (uu_strtoint(value, &new_int, sizeof (new_int), NULL, - NULL, NULL) == -1) + if (uu_strtoint(value, &new_int, sizeof (new_int), 0, + 0, 0) == -1) uu_die(gettext("Error: \"%s\" is not a valid " "integer value.\n"), value); @@ -938,8 +938,8 @@ modify_defaults(int argc, char *argv[]) switch (mod[j].ip_type) { case INET_TYPE_INTEGER: - if (uu_strtoint(value, &new_int, sizeof (new_int), NULL, - NULL, NULL) == -1) + if (uu_strtoint(value, &new_int, sizeof (new_int), 0, + 0, 0) == -1) uu_die(gettext("Error: \"%s\" is not a valid " "integer value.\n"), value); diff --git a/usr/src/cmd/cmd-inet/usr.sbin/ipqosconf/ipqosconf.c b/usr/src/cmd/cmd-inet/usr.sbin/ipqosconf/ipqosconf.c index 914c6f05db..d41ee24918 100644 --- a/usr/src/cmd/cmd-inet/usr.sbin/ipqosconf/ipqosconf.c +++ b/usr/src/cmd/cmd-inet/usr.sbin/ipqosconf/ipqosconf.c @@ -3096,7 +3096,7 @@ int ifindex) /* truncate any logical suffix */ if ((cp = strchr(lr->lifr_name, '@')) != NULL) { - *cp = NULL; + *cp = '\0'; } /* print interface name */ @@ -4265,8 +4265,8 @@ int *upper) *upper = (int)strtol(cp, &end2, 10); SKIPWS(end); SKIPWS(end2); - if ((range_st == end) || (*end != NULL) || - (cp == end) || (*end2 != NULL)) { + if ((range_st == end) || (*end != '\0') || + (cp == end) || (*end2 != '\0')) { IPQOSCDBG0(L0, "Failed reading a-b\n"); return (IPQOS_CONF_ERR); } @@ -4275,7 +4275,7 @@ int *upper) *lower = *upper = (int)strtol(range_st, &end, 10); SKIPWS(end); - if ((range_st == end) || (*end != NULL)) { + if ((range_st == end) || (*end != '\0')) { IPQOSCDBG0(L0, "Failed reading a\n"); return (IPQOS_CONF_ERR); } @@ -4405,7 +4405,7 @@ str_val_nd_t *enum_nvs) } else { value = (int)strtol(svalue, &end, 10); SKIPWS(end); - if ((svalue == end) || (*end != NULL)) { + if ((svalue == end) || (*end != '\0')) { IPQOSCDBG0(L0, "Invalid value\n"); goto array_err; } @@ -4971,7 +4971,7 @@ read_enum_nvs(char *line, char *module_name) goto fail; } bcopy(start, name, len); - name[len] = NULL; + name[len] = '\0'; IPQOSCDBG1(L0, "Stored name: %s\n", name); /* read assignment */ @@ -5190,7 +5190,7 @@ char *module) token = strtok(info_str, ","); *size = (uint32_t)strtol(token, &end, 10); SKIPWS(end); - if ((end == token) || (*end != NULL)) { + if ((end == token) || (*end != '\0')) { IPQOSCDBG0(L0, "Invalid size\n"); goto fail; } @@ -9326,7 +9326,7 @@ char *dstpath) /* not pwd or root */ } else { - *pathend = NULL; + *pathend = '\0'; tmppath = malloc(strlen(dstpath) + strlen("/ipqosconf.tmp") + 1); if (tmppath == NULL) { diff --git a/usr/src/cmd/cmd-inet/usr.sbin/ipsecutils/ikeadm.c b/usr/src/cmd/cmd-inet/usr.sbin/ipsecutils/ikeadm.c index 60f3ed937c..e6257c6184 100644 --- a/usr/src/cmd/cmd-inet/usr.sbin/ipsecutils/ikeadm.c +++ b/usr/src/cmd/cmd-inet/usr.sbin/ipsecutils/ikeadm.c @@ -735,7 +735,7 @@ static keywdtab_t idtypes[] = { {SADB_X_IDENTTYPE_ADDR_RANGE, "rangev4"}, {SADB_X_IDENTTYPE_ADDR_RANGE, "rangev6"}, {SADB_X_IDENTTYPE_KEY_ID, "keyid"}, - {NULL, 0} + {0, NULL} }; static int @@ -903,7 +903,7 @@ static keywdtab_t psfldtypes[] = { {PSFLD_REMIDTYPE, "remoteidtype"}, {PSFLD_MODE, "ike_mode"}, {PSFLD_KEY, "key"}, - {NULL, 0} + {0, NULL} }; static int @@ -929,7 +929,7 @@ static keywdtab_t ikemodes[] = { {IKE_XCHG_IDENTITY_PROTECT, "main"}, {IKE_XCHG_AGGRESSIVE, "aggressive"}, {IKE_XCHG_IP_AND_AGGR, "both"}, - {NULL, 0} + {0, NULL} }; static int @@ -3348,7 +3348,7 @@ parseit(int argc, char **argv, char *notused, boolean_t notused_either) case IKE_SVC_DUMP_AUTHALGS: case IKE_SVC_DUMP_PS: case IKE_SVC_DUMP_CERTCACHE: - if (argc != NULL) { + if (argc != 0) { print_dump_help(); break; } diff --git a/usr/src/cmd/cmd-inet/usr.sbin/ipsecutils/ipsecconf.c b/usr/src/cmd/cmd-inet/usr.sbin/ipsecutils/ipsecconf.c index fbd72b9a40..e8203530b4 100644 --- a/usr/src/cmd/cmd-inet/usr.sbin/ipsecutils/ipsecconf.c +++ b/usr/src/cmd/cmd-inet/usr.sbin/ipsecutils/ipsecconf.c @@ -3026,7 +3026,7 @@ parse_address(int type, char *addr_str) ptr = strchr(addr_str, '/'); if (ptr != NULL) { has_mask = B_TRUE; - *ptr++ = NULL; + *ptr++ = '\0'; prefix_len = in_getprefixlen(ptr); if (prefix_len < 0) { @@ -3740,14 +3740,14 @@ scan: /* Truncate at the beginning of a comment */ cp = strchr(buf, '#'); if (cp != NULL) - *cp = NULL; + *cp = '\0'; /* Skip any whitespace */ - while (*buf != NULL && isspace(*buf)) + while (*buf != '\0' && isspace(*buf)) buf++; /* Empty line */ - if (*buf == NULL) + if (*buf == '\0') continue; /* @@ -3772,15 +3772,15 @@ scan: tmp_buf = buf; /* Skip until next whitespace or CURL_BEGIN */ - while (*buf != NULL && !isspace(*buf) && + while (*buf != '\0' && !isspace(*buf) && *buf != CURL_BEGIN) buf++; - if (*buf != NULL) { + if (*buf != '\0') { if (tmp_buf == buf) /* No action token */ goto error; if (*buf == CURL_BEGIN) { - *buf = NULL; + *buf = '\0'; /* Allocate an extra byte for the null also */ if ((*action = malloc(strlen(tmp_buf) + 1)) == NULL) { @@ -3791,7 +3791,7 @@ scan: *buf = CURL_BEGIN; } else { /* We have hit a space */ - *buf++ = NULL; + *buf++ = '\0'; /* Allocate an extra byte for the null also */ if ((*action = malloc(strlen(tmp_buf) + 1)) == NULL) { @@ -3804,7 +3804,7 @@ scan: * Copy the rest of the line into the * leftover buffer. */ - if (*buf != NULL) { + if (*buf != '\0') { (void) strlcpy(lo_buf, buf, sizeof (lo_buf)); *leftover = lo_buf; } else { @@ -3873,14 +3873,14 @@ scan: /* Truncate at the beginning of a comment */ cp = strchr(buf, '#'); if (cp != NULL) - *cp = NULL; + *cp = '\0'; /* Skip any whitespace */ - while (*buf != NULL && isspace(*buf)) + while (*buf != '\0' && isspace(*buf)) buf++; /* Empty line */ - if (*buf == NULL) + if (*buf == '\0') continue; /* * Store the command for error reporting @@ -3920,15 +3920,15 @@ scan: * Arguments are separated by white spaces or * newlines. Scan till you see a CURL_END. */ - while (*buf != NULL) { + while (*buf != '\0') { if (*buf == CURL_END) { ret: - *buf++ = NULL; + *buf++ = '\0'; /* * Copy the rest of the line into the * leftover buffer if any. */ - if (*buf != NULL) { + if (*buf != '\0') { (void) strlcpy(lo_buf, buf, sizeof (lo_buf)); *leftover = lo_buf; @@ -3941,14 +3941,14 @@ ret: * Skip any trailing whitespace until we see a * non white-space character. */ - while (*buf != NULL && isspace(*buf)) + while (*buf != '\0' && isspace(*buf)) buf++; if (*buf == CURL_END) goto ret; /* Scan the next line as this buffer is empty */ - if (*buf == NULL) + if (*buf == '\0') break; if (i >= MAXARGS) { @@ -3965,7 +3965,7 @@ ret: * Real scan of the argument takes place here. * Skip past till space or CURL_END. */ - while (*buf != NULL && !isspace(*buf) && + while (*buf != '\0' && !isspace(*buf) && *buf != CURL_END) { buf++; } @@ -3973,9 +3973,9 @@ ret: * Either a space or we have hit the CURL_END or * the real end. */ - if (*buf != NULL) { + if (*buf != '\0') { if (*buf == CURL_END) { - *buf++ = NULL; + *buf++ = '\0'; if ((argvec[i] = malloc(strlen(tmp_buf) + 1)) == NULL) { warn("malloc"); @@ -3993,7 +3993,7 @@ ret: * Copy the rest of the line into the * leftover buffer. */ - if (*buf != NULL) { + if (*buf != '\0') { (void) strlcpy(lo_buf, buf, sizeof (lo_buf)); *leftover = lo_buf; @@ -4002,7 +4002,7 @@ ret: } return (PARSE_SUCCESS); } else { - *buf++ = NULL; + *buf++ = '\0'; } } /* @@ -4151,7 +4151,7 @@ parse_one(FILE *fp, act_prop_t *act_props) if (leftover != NULL) { /* Accomodate spaces at the end */ - while (*leftover != NULL) { + while (*leftover != '\0') { if (*leftover == BACK_SLASH) { warnx(gettext("Invalid line " "continuation character.")); diff --git a/usr/src/cmd/cmd-inet/usr.sbin/ipsecutils/ipseckey.c b/usr/src/cmd/cmd-inet/usr.sbin/ipsecutils/ipseckey.c index 14cb3eb28d..9667fa4047 100644 --- a/usr/src/cmd/cmd-inet/usr.sbin/ipsecutils/ipseckey.c +++ b/usr/src/cmd/cmd-inet/usr.sbin/ipsecutils/ipseckey.c @@ -541,8 +541,8 @@ static struct toktable { {"nat_rport", TOK_NATRPORT, NEXTNUM}, {"encap", TOK_ENCAP, NEXTNUMSTR}, - {"outbound", TOK_FLAG_OUTBOUND, NULL}, - {"inbound", TOK_FLAG_INBOUND, NULL}, + {"outbound", TOK_FLAG_OUTBOUND, 0}, + {"inbound", TOK_FLAG_INBOUND, 0}, {"reserved_bits", TOK_RESERVED, NEXTNUM}, {"replay_value", TOK_REPLAY_VALUE, NEXTNUM}, diff --git a/usr/src/cmd/cmd-inet/usr.sbin/kssl/kssladm/kssladm_create.c b/usr/src/cmd/cmd-inet/usr.sbin/kssl/kssladm/kssladm_create.c index aed788596e..7f3233154f 100644 --- a/usr/src/cmd/cmd-inet/usr.sbin/kssl/kssladm/kssladm_create.c +++ b/usr/src/cmd/cmd-inet/usr.sbin/kssl/kssladm/kssladm_create.c @@ -108,14 +108,14 @@ kmf_to_kssl(int nxkey, KMF_RAW_KEY_DATA *rsa, int ncerts, {CKA_ID, NULL, 0} }; kssl_object_attribute_t kssl_tmpl_attrs[MAX_ATTR_CNT] = { - {SUN_CKA_MODULUS, NULL, 0}, - {SUN_CKA_PUBLIC_EXPONENT, NULL, 0}, - {SUN_CKA_PRIVATE_EXPONENT, NULL, 0}, - {SUN_CKA_PRIME_1, NULL, 0}, - {SUN_CKA_PRIME_2, NULL, 0}, - {SUN_CKA_EXPONENT_1, NULL, 0}, - {SUN_CKA_EXPONENT_2, NULL, 0}, - {SUN_CKA_COEFFICIENT, NULL, 0} + {SUN_CKA_MODULUS, 0, 0}, + {SUN_CKA_PUBLIC_EXPONENT, 0, 0}, + {SUN_CKA_PRIVATE_EXPONENT, 0, 0}, + {SUN_CKA_PRIME_1, 0, 0}, + {SUN_CKA_PRIME_2, 0, 0}, + {SUN_CKA_EXPONENT_1, 0, 0}, + {SUN_CKA_EXPONENT_2, 0, 0}, + {SUN_CKA_COEFFICIENT, 0, 0} }; KMF_BIGINT priv_key_bignums[MAX_ATTR_CNT]; int attr_cnt; diff --git a/usr/src/cmd/cmd-inet/usr.sbin/nwamcfg/nwamcfg.c b/usr/src/cmd/cmd-inet/usr.sbin/nwamcfg/nwamcfg.c index 690377cc2d..263f3f62b2 100644 --- a/usr/src/cmd/cmd-inet/usr.sbin/nwamcfg/nwamcfg.c +++ b/usr/src/cmd/cmd-inet/usr.sbin/nwamcfg/nwamcfg.c @@ -603,7 +603,7 @@ CPL_MATCH_FN(cmd_cpl_fn) return (add_stuff(cpl, line, ncp_scope_cmds, word_end)); } /* should never get here */ - return (NULL); + return (0); } const char * diff --git a/usr/src/cmd/cmd-inet/usr.sbin/snoop/nfs4_xdr.c b/usr/src/cmd/cmd-inet/usr.sbin/snoop/nfs4_xdr.c index 88e2ff0d9f..801611ff9b 100644 --- a/usr/src/cmd/cmd-inet/usr.sbin/snoop/nfs4_xdr.c +++ b/usr/src/cmd/cmd-inet/usr.sbin/snoop/nfs4_xdr.c @@ -1991,7 +1991,7 @@ xdr_entry4(register XDR *xdrs, entry4 *objp) objp->nextentry = (entry4 *)mem_alloc(sizeof (entry4)); if (objp->nextentry == NULL) - return (NULL); + return (FALSE); bzero(objp->nextentry, sizeof (entry4)); objp = objp->nextentry; diff --git a/usr/src/cmd/cmd-inet/usr.sbin/snoop/snoop_ether.c b/usr/src/cmd/cmd-inet/usr.sbin/snoop/snoop_ether.c index 029ed66116..f084365faf 100644 --- a/usr/src/cmd/cmd-inet/usr.sbin/snoop/snoop_ether.c +++ b/usr/src/cmd/cmd-inet/usr.sbin/snoop/snoop_ether.c @@ -100,7 +100,7 @@ interface_t INTERFACES[] = { { DL_6TO4, 0, 9, 1, IPPROTO_ENCAP, IPPROTO_IPV6, ipv4_header_len, interpret_iptun, B_FALSE }, - { (uint_t)-1, 0, 0, 0, 0, NULL, NULL, B_FALSE } + { (uint_t)-1, 0, 0, 0, 0, 0, NULL, B_FALSE } }; /* externals */ diff --git a/usr/src/cmd/cmd-inet/usr.sbin/snoop/snoop_rport.c b/usr/src/cmd/cmd-inet/usr.sbin/snoop/snoop_rport.c index 8e474fe470..77e9d97766 100644 --- a/usr/src/cmd/cmd-inet/usr.sbin/snoop/snoop_rport.c +++ b/usr/src/cmd/cmd-inet/usr.sbin/snoop/snoop_rport.c @@ -167,7 +167,7 @@ reservedport(int proto, int port) switch (proto) { case IPPROTO_TCP: pt = pt_tcp; break; case IPPROTO_UDP: pt = pt_udp; break; - default: return (NULL); + default: return (0); } for (p = pt; p->pt_num; p++) { if (port == p->pt_num) diff --git a/usr/src/cmd/cmd-inet/usr.sbin/soconfig.c b/usr/src/cmd/cmd-inet/usr.sbin/soconfig.c index a9315cb218..6f990db460 100644 --- a/usr/src/cmd/cmd-inet/usr.sbin/soconfig.c +++ b/usr/src/cmd/cmd-inet/usr.sbin/soconfig.c @@ -268,27 +268,27 @@ split_line(char *line, char *argvec[], int maxargvec) /* Truncate at the beginning of a comment */ cp = strchr(line, '#'); if (cp != NULL) - *cp = NULL; + *cp = '\0'; /* CONSTCOND */ while (1) { /* Skip any whitespace */ - while (isspace(*line) && *line != NULL) + while (isspace(*line)) line++; if (i >= maxargvec) return (i); argvec[i] = line; - if (*line == NULL) + if (*line == '\0') return (i); i++; /* Skip until next whitespace */ - while (!isspace(*line) && *line != NULL) + while (!isspace(*line) && *line != '\0') line++; - if (*line != NULL) { + if (*line != '\0') { /* Break off argument */ - *line++ = NULL; + *line++ = '\0'; } } /* NOTREACHED */ diff --git a/usr/src/cmd/consadm/consadm.c b/usr/src/cmd/consadm/consadm.c index d31d7f13d6..cd8eb54394 100644 --- a/usr/src/cmd/consadm/consadm.c +++ b/usr/src/cmd/consadm/consadm.c @@ -24,8 +24,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include "utils.h" #include <locale.h> #include <poll.h> @@ -394,7 +392,7 @@ addtolist(char *dev) buf[0] == SPACE || buf[0] == TAB) continue; len = strlen(buf); - buf[len - 1] = NULL; /* Clear carriage return */ + buf[len - 1] = '\0'; /* Clear carriage return */ if (pathcmp(dev, buf) == 0) { /* they match so use name passed in. */ (void) fprintf(nfp, "%s\n", dev); @@ -457,7 +455,7 @@ removefromlist(char *dev) value[0] == SPACE || value[0] == TAB) continue; len = strlen(value); - value[len - 1] = NULL; /* Clear carriage return */ + value[len - 1] = '\0'; /* Clear carriage return */ if (pathcmp(dev, value) == 0) { /* they match so don't write it */ continue; diff --git a/usr/src/cmd/cpio/cpio.c b/usr/src/cmd/cpio/cpio.c index 1816bddeb3..3de636654c 100644 --- a/usr/src/cmd/cpio/cpio.c +++ b/usr/src/cmd/cpio/cpio.c @@ -88,7 +88,7 @@ typedef ulong_t u_off_t; #define XATTRHDR ".hdr" #define NAMELEN 32 -#define TYPELEN 16 +#define TYPELEN 16 #define PERMLEN 4 #define FILE_COPIED 1 @@ -352,17 +352,17 @@ typedef struct sl_remap { dev_t dev; /* device */ int inode_count; /* # inodes seen on dev */ - struct sl_remap *next; /* next in the chain */ + struct sl_remap *next; /* next in the chain */ } sl_remap_t; /* forward declarations */ -static sl_info_t *sl_info_alloc(void); -static sl_info_t *sl_insert(dev_t, ino_t, int); +static sl_info_t *sl_info_alloc(void); +static sl_info_t *sl_insert(dev_t, ino_t, int); static ulong_t sl_numlinks(dev_t, ino_t, int); static void sl_preview_synonyms(void); static void sl_remember_tgt(const struct stat *, int, int); -static sl_info_t *sl_search(dev_t, ino_t, int); +static sl_info_t *sl_search(dev_t, ino_t, int); static sl_info_t *sl_devhash_lookup(dev_t); static void sl_devhash_insert(dev_t, sl_info_t *); @@ -652,7 +652,7 @@ typedef enum { static struct xattr_hdr *xattrhead; static struct xattr_buf *xattrp; static struct xattr_buf *xattr_linkp; -static int xattrbadhead; /* is extended attribute header bad? */ +static int xattrbadhead; /* is extended attribute header bad? */ static int append_secattr(char **, int *, acl_t *); @@ -1295,7 +1295,7 @@ ckopts(long mask) if (mask & OCH) { t_p = Hdr_p; - while (*t_p != NULL) { + while (*t_p != '\0') { if (isupper(*t_p)) { *t_p = 'a' + (*t_p - 'A'); } @@ -1892,7 +1892,7 @@ creat_spec(int dirfd) curdir = strrchr(nam_p, '.'); - if (curdir != NULL && curdir[1] == NULL) { + if (curdir != NULL && curdir[1] == '\0') { lastslash = strrchr(nam_p, '/'); if (lastslash != NULL) { @@ -2607,10 +2607,10 @@ errout: * Strip off the sparse file information that is prepended to * the compressed sparse file. The information is in the following * format: - * <prepended info size><SP><orig file size><SP><holes info> + * <prepended info size><SP><orig file size><SP><holes info> * where prepended info size is long right justified in 10 bytes. * Holesdata consists of the series of offset pairs: - * <data offset><SP><hole offset><SP><data offset><SP><hole offset>... + * <data offset><SP><hole offset><SP><data offset><SP><hole offset>... * prepended info size and original file size have been read in gethdr(). * We read the rest of holes information here in this function. */ @@ -4070,13 +4070,13 @@ retry_open_attr(int pdirfd, int cwd, char *fullname, char *pattr, char *name, * it will be set to 0. * * Possible return values: - * ATTR_OK Successfully opened and, if needed, changed into the + * ATTR_OK Successfully opened and, if needed, changed into the * attribute directory containing attrname. * ATTR_SKIP The command line specifications don't enable the * processing of the attribute type. - * ATTR_CHDIR_ERR An error occurred while trying to change into an + * ATTR_CHDIR_ERR An error occurred while trying to change into an * attribute directory. - * ATTR_OPEN_ERR An error occurred while trying to open an + * ATTR_OPEN_ERR An error occurred while trying to open an * attribute directory. * ATTR_XATTR_ERR The underlying file system doesn't support extended * attributes. @@ -4673,7 +4673,7 @@ gethdr(void) return (0); else { preptr = &prebuf[0]; - if (*preptr != NULL) { + if (*preptr != '\0') { k = strlen(&prebuf[0]); if (k < PRESIZ) { (void) strcpy(&fullnam[0], &prebuf[0]); @@ -8026,10 +8026,9 @@ is_floppy(int fd) * existing secinfo. */ static int -append_secattr( - char **secinfo, /* existing security info */ - int *secinfo_len, /* length of existing security info */ - acl_t *aclp) /* new attribute data pointer */ +append_secattr(char **secinfo, /* existing security info */ + int *secinfo_len, /* length of existing security info */ + acl_t *aclp) /* new attribute data pointer */ { char *new_secinfo; char *attrtext; @@ -8265,7 +8264,7 @@ xattrs_out(int (*func)()) #if defined(_PC_SATTR_ENABLED) if (SysAtflag) { int filefd; - nvlist_t *slist = NULL; + nvlist_t *slist = NULL; /* * Determine if there are non-transient system @@ -8552,7 +8551,7 @@ prepare_xattr_hdr( { char *bufhead; /* ptr to full buffer */ char *aptr; - struct xattr_hdr *hptr; /* ptr to header in bufhead */ + struct xattr_hdr *hptr; /* ptr to header in bufhead */ struct xattr_buf *tptr; /* ptr to pathing pieces */ int totalen; /* total buffer length */ int len; /* length returned to user */ @@ -9313,7 +9312,7 @@ preview_attrs(char *s, char *attrparent) #if defined(_PC_SATTR_ENABLED) if (SysAtflag) { int filefd; - nvlist_t *slist = NULL; + nvlist_t *slist = NULL; /* Determine if there are non-transient system attributes. */ errno = 0; diff --git a/usr/src/cmd/csh/sh.glob.c b/usr/src/cmd/csh/sh.glob.c index a45e21f936..db0122c0c6 100644 --- a/usr/src/cmd/csh/sh.glob.c +++ b/usr/src/cmd/csh/sh.glob.c @@ -4,7 +4,7 @@ */ /* Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T */ -/* All Rights Reserved */ +/* All Rights Reserved */ /* * Copyright (c) 1980 Regents of the University of California. @@ -12,8 +12,6 @@ * specifies the terms and conditions for redistribution. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include "sh.h" #include "sh.tconst.h" #include <dirent.h> @@ -130,7 +128,7 @@ collect(tchar *as) printf("acollect done\n"); #endif } else if (noglob || eq(as, S_LBRA /* "{" */) || - eq(as, S_BRABRA /* "{}" */)) { + eq(as, S_BRABRA /* "{}" */)) { Gcat(as, S_ /* "" */); sort(); } else @@ -193,7 +191,7 @@ expand(tchar *as) (void) strcpy_(gpath, gpath + 1); } else (void) strcpy_(gpath, - value(S_home /* "home" */)); + value(S_home /* "home" */)); gpathp = strend(gpath); } } @@ -241,7 +239,7 @@ matchdir_(tchar *pattern) * BSD's opendir would open "." if argument is NULL, but not S5 */ - if (*gpath == NULL) + if (*gpath == '\0') dirp = opendir_(S_DOT /* "." */); else dirp = opendir_(gpath); @@ -635,7 +633,7 @@ tglob(tchar **t) if (*p == '~') gflag |= 2; else if (*p == '{' && (p[1] == '\0' || - p[1] == '}' && p[2] == '\0')) + p[1] == '}' && p[2] == '\0')) continue; while (c = *p++) if (isglob(c)) diff --git a/usr/src/cmd/csplit/csplit.c b/usr/src/cmd/csplit/csplit.c index 456780b9a3..21c0e0be49 100644 --- a/usr/src/cmd/csplit/csplit.c +++ b/usr/src/cmd/csplit/csplit.c @@ -24,7 +24,7 @@ */ /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ -/* All Rights Reserved */ +/* All Rights Reserved */ /* * Copyright (c) 2018, Joyent, Inc. @@ -114,7 +114,7 @@ main(int argc, char **argv) break; case 'n': /* POSIX.2 */ - for (ptr = optarg; *ptr != NULL; ptr++) + for (ptr = optarg; *ptr != '\0'; ptr++) if (!isdigit((int)*ptr)) fatal("-n num\n", NULL); fiwidth = atoi(optarg); @@ -225,7 +225,7 @@ asc_to_ll(char *str, long long *plc) } break; } - for (; *str != NULL; str++) + for (; *str != '\0'; str++) if (*str >= '0' && *str <= '9') *plc = *plc * 10 + *str - '0'; else @@ -362,7 +362,7 @@ getfile() if (create) { if (fptr == 0) - for (fptr = file; *fptr != NULL; fptr++) + for (fptr = file; *fptr != '\0'; fptr++) continue; (void) sprintf(fptr, "%.*d", fiwidth, ctr++); @@ -458,7 +458,7 @@ num_arg(char *arg, int md) ptr = rep; for (++arg; *arg != '}'; arg += len) { - if (*arg == NULL) + if (*arg == '\0') fatal("%s: missing '}'\n", targ); if ((len = mblen(arg, MB_LEN_MAX)) <= 0) len = 1; @@ -467,7 +467,7 @@ num_arg(char *arg, int md) (void) memcpy(ptr, arg, len); ptr += len; } - *ptr = NULL; + *ptr = '\0'; if ((asc_to_ll(rep, &repeat) == ERR) || repeat < 0L) fatal("Illegal repeat count: %s\n", targ); if (md == LINMODE) { @@ -506,7 +506,7 @@ re_arg(char *string) if (*ptr == '\\') ++ptr; - if (*ptr == NULL) + if (*ptr == '\0') fatal("%s: missing delimiter\n", targ); if ((len = mblen(ptr, MB_LEN_MAX)) <= 0) @@ -520,7 +520,7 @@ re_arg(char *string) * to be '/' or '%'. */ - *ptr = NULL; + *ptr = '\0'; if (asc_to_ll(++ptr, &offset) == ERR) fatal("%s: illegal offset\n", string); diff --git a/usr/src/cmd/devctl/devctl.c b/usr/src/cmd/devctl/devctl.c index 15b76da9ac..530996dd03 100644 --- a/usr/src/cmd/devctl/devctl.c +++ b/usr/src/cmd/devctl/devctl.c @@ -32,17 +32,17 @@ * usage: devctl [-v] command [device/bus pathname] * * Commands: - * list - list all controllers exporting the devctl interface + * list - list all controllers exporting the devctl interface * online - online a device * offline - offline a device - * remove - remove a device from the device tree - * quiesce - quiesce the bus + * remove - remove a device from the device tree + * quiesce - quiesce the bus * unquiesce - resume bus activity * configure - configure a bus's child devices * unconfigure - unconfigure a bus's child devices * bus-reset - reset a bus * dev-reset - reset a device - * bus-getstate - return the current state of the bus + * bus-getstate - return the current state of the bus * dev-getstate - return the current state of the device * bus-devcreate - create a new device, bus specific * dev-raisepower - power up a device via pm_raise_power() (pm) @@ -181,7 +181,7 @@ int main(int argc, char *argv[]) { int c; - int rv; + int rv; int pathlen; struct cmds *dcmd; devctl_hdl_t dcp; @@ -548,7 +548,7 @@ run_list_ctlrs(void) progname); exit(-1); } - (void) di_walk_minor(dinode, DDI_NT_NEXUS, NULL, 0, &nexif); + (void) di_walk_minor(dinode, DDI_NT_NEXUS, 0, NULL, &nexif); di_fini(dinode); exit(0); } diff --git a/usr/src/cmd/diskinfo/diskinfo.c b/usr/src/cmd/diskinfo/diskinfo.c index 36376827fc..ca09fe027e 100644 --- a/usr/src/cmd/diskinfo/diskinfo.c +++ b/usr/src/cmd/diskinfo/diskinfo.c @@ -264,7 +264,7 @@ enumerate_disks(di_opts_t *opts) topo_strerror(err)); } - for (i = 0; media != NULL && media[i] != NULL; i++) { + for (i = 0; media != NULL && media[i] != 0; i++) { if ((disk = dm_get_associated_descriptors(media[i], DM_DRIVE, &err)) == NULL) { continue; diff --git a/usr/src/cmd/dladm/dladm.c b/usr/src/cmd/dladm/dladm.c index 97fc010fa2..2de38a993c 100644 --- a/usr/src/cmd/dladm/dladm.c +++ b/usr/src/cmd/dladm/dladm.c @@ -450,7 +450,7 @@ static const struct option lopts[] = { {"bw-limit", required_argument, 0, 'b'}, {"mac-address", required_argument, 0, 'm'}, {"slot", required_argument, 0, 'n'}, - { 0, 0, 0, 0 } + { NULL, 0, NULL, 0 } }; static const struct option show_lopts[] = { @@ -463,7 +463,7 @@ static const struct option show_lopts[] = { {"output", required_argument, 0, 'o'}, {"persistent", no_argument, 0, 'P'}, {"lacp", no_argument, 0, 'L'}, - { 0, 0, 0, 0 } + { NULL, 0, NULL, 0 } }; static const struct option iptun_lopts[] = { @@ -474,7 +474,7 @@ static const struct option iptun_lopts[] = { {"parsable", no_argument, 0, 'p'}, {"parseable", no_argument, 0, 'p'}, {"persistent", no_argument, 0, 'P'}, - { 0, 0, 0, 0 } + { NULL, 0, NULL, 0 } }; static char * const iptun_addropts[] = { @@ -502,7 +502,7 @@ static const struct option prop_longopts[] = { {"parsable", no_argument, 0, 'c' }, {"parseable", no_argument, 0, 'c' }, {"persistent", no_argument, 0, 'P' }, - { 0, 0, 0, 0 } + { NULL, 0, NULL, 0 } }; static const struct option wifi_longopts[] = { @@ -522,7 +522,7 @@ static const struct option wifi_longopts[] = { {"root-dir", required_argument, 0, 'R' }, {"persistent", no_argument, 0, 'P' }, {"file", required_argument, 0, 'f' }, - { 0, 0, 0, 0 } + { NULL, 0, NULL, 0 } }; static const struct option showeth_lopts[] = { @@ -530,7 +530,7 @@ static const struct option showeth_lopts[] = { {"parseable", no_argument, 0, 'p' }, {"extended", no_argument, 0, 'x' }, {"output", required_argument, 0, 'o' }, - { 0, 0, 0, 0 } + { NULL, 0, NULL, 0 } }; static const struct option vnic_lopts[] = { @@ -544,7 +544,7 @@ static const struct option vnic_lopts[] = { {"mac-prefix", required_argument, 0, 'r' }, {"vrid", required_argument, 0, 'V' }, {"address-family", required_argument, 0, 'A' }, - { 0, 0, 0, 0 } + { NULL, 0, NULL, 0 } }; static const struct option part_lopts[] = { @@ -554,7 +554,7 @@ static const struct option part_lopts[] = { {"force", no_argument, 0, 'f' }, {"root-dir", required_argument, 0, 'R' }, {"prop", required_argument, 0, 'p' }, - { 0, 0, 0, 0 } + { NULL, 0, NULL, 0 } }; static const struct option show_part_lopts[] = { @@ -563,13 +563,13 @@ static const struct option show_part_lopts[] = { {"link", required_argument, 0, 'l' }, {"persistent", no_argument, 0, 'P' }, {"output", required_argument, 0, 'o' }, - { 0, 0, 0, 0 } + { NULL, 0, NULL, 0 } }; static const struct option etherstub_lopts[] = { {"temporary", no_argument, 0, 't' }, {"root-dir", required_argument, 0, 'R' }, - { 0, 0, 0, 0 } + { NULL, 0, NULL, 0 } }; static const struct option usage_opts[] = { @@ -577,7 +577,7 @@ static const struct option usage_opts[] = { {"format", required_argument, 0, 'F' }, {"start", required_argument, 0, 's' }, {"stop", required_argument, 0, 'e' }, - { 0, 0, 0, 0 } + { NULL, 0, NULL, 0 } }; static const struct option simnet_lopts[] = { @@ -585,7 +585,7 @@ static const struct option simnet_lopts[] = { {"root-dir", required_argument, 0, 'R' }, {"media", required_argument, 0, 'm' }, {"peer", required_argument, 0, 'p' }, - { 0, 0, 0, 0 } + { NULL, 0, NULL, 0 } }; static const struct option bridge_lopts[] = { @@ -597,7 +597,7 @@ static const struct option bridge_lopts[] = { { "link", required_argument, 0, 'l' }, { "max-age", required_argument, 0, 'm' }, { "priority", required_argument, 0, 'p' }, - { NULL, NULL, 0, 0 } + { NULL, 0, NULL, 0 } }; static const struct option bridge_show_lopts[] = { @@ -609,7 +609,7 @@ static const struct option bridge_show_lopts[] = { { "parseable", no_argument, 0, 'p' }, { "statistics", no_argument, 0, 's' }, { "trill", no_argument, 0, 't' }, - { 0, 0, 0, 0 } + { NULL, 0, NULL, 0 } }; /* @@ -862,7 +862,7 @@ static const ofmt_field_t phys_fields[] = { offsetof(link_fields_buf_t, link_phys_device), print_default_cb}, { "FLAGS", 7, offsetof(link_fields_buf_t, link_flags), print_default_cb}, -{ NULL, 0, NULL, 0}} +{ NULL, 0, 0, NULL}} ; /* @@ -6348,7 +6348,7 @@ parse_wlan_keys(char *str, dladm_wlan_key_t **keys, uint_t *key_countp) char *field, *token, *lasts = NULL, c; token = str; - while ((c = *token++) != NULL) { + while ((c = *token++) != '\0') { if (c == ',') nfields++; } @@ -7553,7 +7553,7 @@ do_delete_secobj(int argc, char **argv, const char *use) die("secure object name required"); token = argv[optind]; - while ((c = *token++) != NULL) { + while ((c = *token++) != '\0') { if (c == ',') nfields++; } @@ -7706,7 +7706,7 @@ do_show_secobj(int argc, char **argv, const char *use) token = argv[optind]; if (token == NULL) die("secure object name required"); - while ((c = *token++) != NULL) { + while ((c = *token++) != '\0') { if (c == ',') obj_fields++; } diff --git a/usr/src/cmd/eeprom/i386/benv.c b/usr/src/cmd/eeprom/i386/benv.c index 11613cc5ce..0e3a89f0b7 100644 --- a/usr/src/cmd/eeprom/i386/benv.c +++ b/usr/src/cmd/eeprom/i386/benv.c @@ -360,7 +360,7 @@ add_comm(benv_des_t *bd, char *base, char *last, char **next, int *line) nl = 0; } } - *(p - 1) = NULL; + *(p - 1) = '\0'; add_bent(bd->elist, base, NULL, NULL, NULL); *next = p; *line += lines; diff --git a/usr/src/cmd/logins/Makefile b/usr/src/cmd/logins/Makefile index d9df94c5b9..865f2163bd 100644 --- a/usr/src/cmd/logins/Makefile +++ b/usr/src/cmd/logins/Makefile @@ -21,11 +21,10 @@ # # # Copyright (c) 1990 by Sun Microsystems, Inc. +# Copyright 2019 Peter Tribble. # -PROG= logins -PKGINFO= pkginfo -TXTS= $(PKGINFO) +PROG= logins include ../Makefile.cmd TEXT_DOMAIN= SUNW_OST_ADMIN @@ -37,7 +36,7 @@ FILEMODE= 0750 .KEEP_STATE: -all: $(PROG) $(TXTS) +all: $(PROG) install: all $(ROOTPROG) diff --git a/usr/src/cmd/logins/logins.xcl b/usr/src/cmd/logins/logins.xcl deleted file mode 100644 index f2e56d8dea..0000000000 --- a/usr/src/cmd/logins/logins.xcl +++ /dev/null @@ -1,21 +0,0 @@ -# -# CDDL HEADER START -# -# The contents of this file are subject to the terms of the -# Common Development and Distribution License, Version 1.0 only -# (the "License"). You may not use this file except in compliance -# with the License. -# -# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE -# or http://www.opensolaris.org/os/licensing. -# See the License for the specific language governing permissions -# and limitations under the License. -# -# When distributing Covered Code, include this CDDL HEADER in each -# file and include the License file at usr/src/OPENSOLARIS.LICENSE. -# If applicable, add the following below this CDDL HEADER, with the -# fields enclosed by brackets "[]" replaced with your own identifying -# information: Portions Copyright [yyyy] [name of copyright owner] -# -# CDDL HEADER END -# diff --git a/usr/src/cmd/logins/pkginfo b/usr/src/cmd/logins/pkginfo deleted file mode 100644 index c5683498ef..0000000000 --- a/usr/src/cmd/logins/pkginfo +++ /dev/null @@ -1,33 +0,0 @@ -# CDDL HEADER START -# -# The contents of this file are subject to the terms of the -# Common Development and Distribution License, Version 1.0 only -# (the "License"). You may not use this file except in compliance -# with the License. -# -# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE -# or http://www.opensolaris.org/os/licensing. -# See the License for the specific language governing permissions -# and limitations under the License. -# -# When distributing Covered Code, include this CDDL HEADER in each -# file and include the License file at usr/src/OPENSOLARIS.LICENSE. -# If applicable, add the following below this CDDL HEADER, with the -# fields enclosed by brackets "[]" replaced with your own identifying -# information: Portions Copyright [yyyy] [name of copyright owner] -# -# CDDL HEADER END -# -# Copyright 1992 Sun Microsystems, Inc. All rights reserved. -# Use is subject to license terms. -# -#ident "%Z%%M% %I% %E% SMI" /* SVr4.0 1.1 */ -# -# This is the package info file for -# the user command "logins" in the user administration display facility. -# -# -PKG="cfg" -NAME="Configuration Display" -VERSION="0.0" -CATEGORY="system" diff --git a/usr/src/cmd/lp/cmd/lpsched/disp1.c b/usr/src/cmd/lp/cmd/lpsched/disp1.c index b3f96ccd21..a1c2dc5ccf 100644 --- a/usr/src/cmd/lp/cmd/lpsched/disp1.c +++ b/usr/src/cmd/lp/cmd/lpsched/disp1.c @@ -1161,7 +1161,7 @@ s_pass_peer_connection(char *m, MESG *md) (void) getmessage(m, S_PASS_PEER_CONNECTION); syslog(LOG_DEBUG, "s_pass_peer_connection()"); - memset(&recv_fd, NULL, sizeof (recv_fd)); + memset(&recv_fd, 0, sizeof (recv_fd)); if (ioctl(md->readfd, I_RECVFD, &recv_fd) == 0) { int fd = recv_fd.fd; diff --git a/usr/src/cmd/lp/cmd/lpsched/exec.c b/usr/src/cmd/lp/cmd/lpsched/exec.c index 521a55eaa1..dd9c939d78 100644 --- a/usr/src/cmd/lp/cmd/lpsched/exec.c +++ b/usr/src/cmd/lp/cmd/lpsched/exec.c @@ -111,7 +111,7 @@ void clean_string(char *ptr) wchar_t wc; size_t len; - for (cp = ptr; *cp != NULL; ) { + for (cp = ptr; *cp != '\0'; ) { if ((len = mbtowc(&wc, cp, MB_CUR_MAX)) == -1) { cp++; continue; @@ -735,7 +735,7 @@ exec(int type, ...) } else if (strcmp(clean_title, "") != 0) { char *ct_p; - for (ct_p = clean_title; *ct_p != NULL; ct_p++) { + for (ct_p = clean_title; *ct_p != '\0'; ct_p++) { if (*ct_p == '"') *ct_p = ' '; } diff --git a/usr/src/cmd/lp/cmd/lpsched/files.c b/usr/src/cmd/lp/cmd/lpsched/files.c index 00f2ac85be..a608e2ad82 100644 --- a/usr/src/cmd/lp/cmd/lpsched/files.c +++ b/usr/src/cmd/lp/cmd/lpsched/files.c @@ -27,8 +27,6 @@ /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ /* All Rights Reserved */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include "lpsched.h" #include <syslog.h> #include <strings.h> @@ -172,7 +170,7 @@ void rmfiles ( RSTATUS * rp, int log_it ) /* funcdef */ p = strdup(rp->req_file); /* remove host/id file */ if (q = strrchr(p, '-')) { - *q = NULL; + *q = '\0'; path = makepath(Lp_Tmp, p, NULL); (void) Unlink(path); Free(path); diff --git a/usr/src/cmd/lp/cmd/lpsched/fncs.c b/usr/src/cmd/lp/cmd/lpsched/fncs.c index 66f8311fa7..c73b159b96 100644 --- a/usr/src/cmd/lp/cmd/lpsched/fncs.c +++ b/usr/src/cmd/lp/cmd/lpsched/fncs.c @@ -898,7 +898,7 @@ void GetRequestFiles(REQUEST *req, char *buffer, int length) } else if (req->file_list) strlcpy(buf, *req->file_list, sizeof (buf)); - if (*buf == NULL || !strncmp(buf, SPOOLDIR, sizeof(SPOOLDIR)-1)) + if (*buf == '\0' || !strncmp(buf, SPOOLDIR, sizeof(SPOOLDIR)-1)) strcpy(buf, "<File name not available>"); if (strlen(buf) > (size_t) 24) { diff --git a/usr/src/cmd/lp/cmd/lpsched/lpfsck.c b/usr/src/cmd/lp/cmd/lpsched/lpfsck.c index 3175ae2d17..8b569227d3 100644 --- a/usr/src/cmd/lp/cmd/lpsched/lpfsck.c +++ b/usr/src/cmd/lp/cmd/lpsched/lpfsck.c @@ -27,8 +27,6 @@ /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ /* All Rights Reserved */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include "stdarg.h" #include "stdlib.h" #include "fcntl.h" @@ -323,7 +321,7 @@ va_makepath (va_list *pap, char **ret) char buf[MAXPATHLEN]; int buflen; - memset(buf, NULL, sizeof (buf)); + memset(buf, 0, sizeof (buf)); while ((component = va_arg((*pap), char *)) != NULL) { if (strlcat(buf, component, sizeof (buf)) >= sizeof (buf) || strlcat(buf, "/", sizeof (buf)) >= sizeof (buf)) { diff --git a/usr/src/cmd/lp/filter/postscript/postprint/postprint.c b/usr/src/cmd/lp/filter/postscript/postprint/postprint.c index 49fe4bb3df..8306342860 100644 --- a/usr/src/cmd/lp/filter/postscript/postprint/postprint.c +++ b/usr/src/cmd/lp/filter/postscript/postprint/postprint.c @@ -27,8 +27,6 @@ /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ /* All Rights Reserved */ -#pragma ident "%Z%%M% %I% %E% SMI" - /* * * postprint - PostScript translator for ASCII files. @@ -107,6 +105,7 @@ #include <ctype.h> #include <fcntl.h> #include <unistd.h> +#include <string.h> #include "comments.h" /* PostScript file structuring comments */ #include "gen.h" /* general purpose definitions */ diff --git a/usr/src/cmd/lp/filter/postscript/postreverse/postreverse.c b/usr/src/cmd/lp/filter/postscript/postreverse/postreverse.c index 72de24d3cd..4b4ab335d8 100644 --- a/usr/src/cmd/lp/filter/postscript/postreverse/postreverse.c +++ b/usr/src/cmd/lp/filter/postscript/postreverse/postreverse.c @@ -23,8 +23,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include <stdio.h> #include <stdlib.h> #include <sys/types.h> @@ -254,7 +252,7 @@ ParsePageList(char *list) char *s1 = page, *s2; if (s2 = strchr(page, '-')) { - *s2++ = NULL; + *s2++ = '\0'; start = atoi(s1); end = atoi(s2); if (end < start) { diff --git a/usr/src/cmd/lp/lib/lp/files.c b/usr/src/cmd/lp/lib/lp/files.c index d85484f547..45b9f10869 100644 --- a/usr/src/cmd/lp/lib/lp/files.c +++ b/usr/src/cmd/lp/lib/lp/files.c @@ -28,7 +28,6 @@ /* All Rights Reserved */ -#pragma ident "%Z%%M% %I% %E% SMI" /* EMACS_MODES: !fill, lnumb, !overwrite, !nodelete, !picture */ #include "stdio.h" @@ -96,7 +95,7 @@ fdgets(char *buf, int len, int fd) char tmp; int count = 0; - memset(buf, NULL, len); + memset(buf, 0, len); while ((count < len) && (Read(fd, &tmp, 1) > 0)) if ((buf[count++] = tmp) == '\n') break; diff --git a/usr/src/cmd/lp/lib/papi/job.c b/usr/src/cmd/lp/lib/papi/job.c index aafce80d0c..d4b0bc078f 100644 --- a/usr/src/cmd/lp/lib/papi/job.c +++ b/usr/src/cmd/lp/lib/papi/job.c @@ -971,7 +971,7 @@ papiJobQuery(papi_service_t handle, char *printer, int32_t job_id, return (PAPI_DEVICE_ERROR); } - if ((request_id == NULL) || (request_id[0] == NULL)) + if ((request_id == NULL) || (request_id[0] == '\0')) return (PAPI_NOT_FOUND); if ((*job = j = calloc(1, sizeof (*j))) == NULL) diff --git a/usr/src/cmd/lp/lib/papi/lpsched-jobs.c b/usr/src/cmd/lp/lib/papi/lpsched-jobs.c index 0713de64c2..3232b89667 100644 --- a/usr/src/cmd/lp/lib/papi/lpsched-jobs.c +++ b/usr/src/cmd/lp/lib/papi/lpsched-jobs.c @@ -103,7 +103,7 @@ job_attributes_to_lpsched_request(papi_service_t svc, REQUEST *r, papiAttributeListGetLPString(attributes, "form", &r->form); /* set the page range */ - memset(tmp, NULL, sizeof (tmp)); + memset(tmp, 0, sizeof (tmp)); tmp[0] = papiAttributeListFind(attributes, "page-ranges"); if (tmp[0] != NULL) { char buf[BUFSIZ]; @@ -369,11 +369,11 @@ lpsched_request_outcome_to_attributes(papi_attribute_t ***attributes, static void lpsched_user_to_job_attributes(papi_attribute_t ***list, char *user) { - if ((list != NULL) && (user != NULL) && (user[0] != NULL)) { + if ((list != NULL) && (user != NULL) && (user[0] != '\0')) { char *host = strrchr(user, '@'); if (host != NULL) { - *host = NULL; + *host = '\0'; papiAttributeListAddString(list, PAPI_ATTR_REPLACE, "job-originating-user-name", user); papiAttributeListAddString(list, PAPI_ATTR_REPLACE, diff --git a/usr/src/cmd/lp/lib/papi/lpsched-misc.c b/usr/src/cmd/lp/lib/papi/lpsched-misc.c index ce45d1aa5c..6675bdd213 100644 --- a/usr/src/cmd/lp/lib/papi/lpsched-misc.c +++ b/usr/src/cmd/lp/lib/papi/lpsched-misc.c @@ -23,8 +23,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - /*LINTLIBRARY*/ #include <stdio.h> @@ -41,7 +39,7 @@ papiAttributeListAddLPString(papi_attribute_t ***list, int flags, char *name, papi_status_t result = PAPI_BAD_ARGUMENT; if ((list != NULL) && (name != NULL) && (value != NULL) && - (value[0] != NULL)) + (value[0] != '\0')) result = papiAttributeListAddString(list, flags, name, value); return (result); } @@ -119,7 +117,7 @@ printer_name_from_uri_id(char *uri, int32_t id) result = ""; } - if ((result[0] == NULL) && (id != -1)) { + if ((result[0] == '\0') && (id != -1)) { char path[32]; snprintf(path, sizeof (path), "%d-0", id); diff --git a/usr/src/cmd/lp/lib/papi/ppd.c b/usr/src/cmd/lp/lib/papi/ppd.c index 57d42c8841..26fcced189 100644 --- a/usr/src/cmd/lp/lib/papi/ppd.c +++ b/usr/src/cmd/lp/lib/papi/ppd.c @@ -54,7 +54,7 @@ process_line(char *line, char **key, char **value, char **comment) * or * *key value/comment: data */ - *ptr++ = NULL; + *ptr++ = '\0'; while (isspace(*ptr) != 0) ptr++; @@ -64,7 +64,7 @@ process_line(char *line, char **key, char **value, char **comment) * line is in the form: * *key value/comment: data */ - *ptr++ = NULL; + *ptr++ = '\0'; while (*ptr == ' ') ptr++; } @@ -75,7 +75,7 @@ process_line(char *line, char **key, char **value, char **comment) *value = ptr; if ((ptr = strchr(ptr, '/')) != NULL) { - *ptr++ = NULL; + *ptr++ = '\0'; *comment = ptr; } } @@ -107,7 +107,7 @@ PPDFileToAttributesList(papi_attribute_t ***attributes, char *filename) continue; if ((text = strrchr(line, '\n')) != NULL) - *text = NULL; + *text = '\0'; process_line(line, &key, &value, &text); diff --git a/usr/src/cmd/lp/model/netpr/netpr.c b/usr/src/cmd/lp/model/netpr/netpr.c index 9516781fad..243200a4cf 100644 --- a/usr/src/cmd/lp/model/netpr/netpr.c +++ b/usr/src/cmd/lp/model/netpr/netpr.c @@ -89,7 +89,7 @@ net_open(char *host, int timeout) return (-1); } - (void) memset((char *)&sin, NULL, sizeof (sin)); + (void) memset((char *)&sin, 0, sizeof (sin)); if ((hp = getipnodebyname(host, AF_INET6, AI_DEFAULT, &error_num)) == NULL) { syslog(LOG_DEBUG|LOG_ERR, "unknown host %s " diff --git a/usr/src/cmd/sgs/pvs/common/pvs.c b/usr/src/cmd/sgs/pvs/common/pvs.c index 4c353b887c..5a53021e09 100644 --- a/usr/src/cmd/sgs/pvs/common/pvs.c +++ b/usr/src/cmd/sgs/pvs/common/pvs.c @@ -22,6 +22,7 @@ /* * Copyright 2010 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. + * Copyright 2019 Joyent, Inc. */ /* @@ -91,7 +92,7 @@ typedef struct gver_desc { /* Versym related data used by gvers_syms() */ typedef struct { - GElf_Versym *vsd_vsp; /* ptr to versym data */ + GElf_Versym *vsd_vsp; /* ptr to versym data */ Elf_Data *vsd_sym_data; /* ptr to symtab data */ Word vsd_symn; /* # of symbols in symtab */ const char *vsd_strs; /* string table data */ @@ -710,7 +711,7 @@ gvers_find(const char *name, unsigned long hash, APlist *lst) * * exit: * Return the corresponding GVer_desc struct. If the - * descriptor does not already exist, it is created. + * descriptor does not already exist, it is created. * On error, a fatal error is issued and the process exits. */ static GVer_desc * @@ -766,7 +767,7 @@ static void gvers_derefer(GVer_desc *vdp, int weak) { Aliste idx; - GVer_desc *_vdp; + GVer_desc *_vdp; /* * If the head of the list was a weak then we only clear out @@ -874,7 +875,7 @@ gvers_def(Cache *cache, Cache *def, const Gver_sym_data *vsdata, if (nflag) { for (APLIST_TRAVERSE(verdefs, idx1, vdp)) { Aliste idx2; - GVer_desc *_vdp; + GVer_desc *_vdp; int type = vdp->vd_flags & VER_FLG_WEAK; for (APLIST_TRAVERSE(vdp->vd_deps, idx2, _vdp)) @@ -895,7 +896,7 @@ gvers_def(Cache *cache, Cache *def, const Gver_sym_data *vsdata, */ for (APLIST_TRAVERSE(verdefs, idx1, vdp)) { Aliste idx2; - GVer_desc *_vdp; + GVer_desc *_vdp; int count; if (!match(NULL, vdp->vd_name, vdp->vd_ndx)) @@ -1006,13 +1007,13 @@ main(int argc, char **argv, char **envp) Elf *elf; Elf_Scn *scn; Elf_Data *data; - GElf_Ehdr ehdr; + GElf_Ehdr ehdr; int nfile, var; char *names; Cache *cache, *_cache; Cache *_cache_def, *_cache_need, *_cache_sym, *_cache_loc; int error = 0; - Gver_sym_data vsdata_s; + Gver_sym_data vsdata_s; const Gver_sym_data *vsdata = NULL; /* diff --git a/usr/src/cmd/sgs/rtld/common/analyze.c b/usr/src/cmd/sgs/rtld/common/analyze.c index 3cae1036ae..c9e66b1293 100644 --- a/usr/src/cmd/sgs/rtld/common/analyze.c +++ b/usr/src/cmd/sgs/rtld/common/analyze.c @@ -712,9 +712,9 @@ _is_so_matched(const char *name, const char *str, int path) * path names can be supplied as dependencies, e.g. dlopen("../libx.so.1"). * * - a PATHNAME() - this is the fully resolved path name of the object. This - * name will differ from NAME() for all dynamic executables, and may differ + * name will differ from NAME() for all dynamic executables, and may differ * from the NAME() of dependencies, if the dependency is not a full path - * name, or the dependency resolves to a symbolic link. + * name, or the dependency resolves to a symbolic link. * * - an ALIAS() name - these are alternative names by which the object has * been found, ie. when dependencies are loaded through a variety of @@ -1544,7 +1544,7 @@ find_file(Lm_list *lml, Rt_map *clmp, uint_t flags, Fdesc *fdp, Rej_desc *rej, * If we found a directory search for the file. */ if (dobj->co_id != 0) { - if (*strhash == NULL) + if (*strhash == 0) *strhash = (Word)elf_hash(oname); fobj = elf_config_ent(oname, *strhash, dobj->co_id, &aname); @@ -2432,7 +2432,7 @@ load_finish(Lm_list *lml, const char *name, Rt_map *clmp, int nmode, for (APLIST_TRAVERSE(lmalp, idx2, dlmp1)) { Aliste idx3; - Bnd_desc *bdp; + Bnd_desc *bdp; /* * Add any dependencies of this dependency to the @@ -2608,7 +2608,7 @@ load_one(Lm_list *lml, Aliste lmco, Alist *palp, Rt_map *clmp, int mode, { Rej_desc rej = { 0 }; Aliste idx; - Pdesc *pdp; + Pdesc *pdp; const char *name; for (ALIST_TRAVERSE(palp, idx, pdp)) { @@ -2779,7 +2779,7 @@ lookup_sym_interpose(Slookup *slp, Sresult *srp, uint_t *binfo, int *in_nfavl) } if ((lml->lm_flags & LML_FLG_INTRPOSE) == 0) - return (NULL); + return (0); /* * Traverse the list of known interposers to determine whether any @@ -3191,7 +3191,7 @@ _lookup_sym(Slookup *slp, Sresult *srp, uint_t *binfo, int *in_nfavl) lml = LIST(lmp); if ((sl.sl_flags & LKUP_WEAK) || (lml->lm_lazy == 0)) - return (NULL); + return (0); DBG_CALL(Dbg_syms_lazy_rescan(lml, name)); diff --git a/usr/src/cmd/sgs/rtld/common/cap.c b/usr/src/cmd/sgs/rtld/common/cap.c index 9aa82022be..47abbc78bc 100644 --- a/usr/src/cmd/sgs/rtld/common/cap.c +++ b/usr/src/cmd/sgs/rtld/common/cap.c @@ -362,7 +362,7 @@ cap_check(Cap *cptr, char *strs, int alt, Fdesc *fdp, Rej_desc *rej) return (1); } -#define HWAVL_RECORDED(n) pnavl_recorded(&capavl, n, NULL, NULL) +#define HWAVL_RECORDED(n) pnavl_recorded(&capavl, n, 0, NULL) /* * Determine whether a link-map should use alternative system capabilities. diff --git a/usr/src/cmd/sgs/rtld/common/config_elf.c b/usr/src/cmd/sgs/rtld/common/config_elf.c index b0b0977cab..e2de5eeff3 100644 --- a/usr/src/cmd/sgs/rtld/common/config_elf.c +++ b/usr/src/cmd/sgs/rtld/common/config_elf.c @@ -116,7 +116,7 @@ elf_config_validate(Addr addr, Rtc_head *head, Rt_map *lmp) * RTC_OBJ_NOEXIST directories. */ filetbl = (Rtc_file *)(dirtbl->cd_file + addr); - if (filetbl->cf_obj == NULL) + if (filetbl->cf_obj == 0) continue; /* @@ -332,7 +332,7 @@ elf_config(Rt_map *lmp, int aout) } #endif if (expand_paths(lmp, str, &elf_def_dirs, AL_CNT_SEARCH, - (LA_SER_DEFAULT | LA_SER_CONFIG), PD_TKN_CAP) != NULL) + (LA_SER_DEFAULT | LA_SER_CONFIG), PD_TKN_CAP) != 0) features |= CONF_EDLIBPATH; } if (head->ch_eslibpath) { @@ -350,20 +350,20 @@ elf_config(Rt_map *lmp, int aout) } #endif if (expand_paths(lmp, str, &elf_sec_dirs, AL_CNT_SEARCH, - (LA_SER_SECURE | LA_SER_CONFIG), PD_TKN_CAP) != NULL) + (LA_SER_SECURE | LA_SER_CONFIG), PD_TKN_CAP) != 0) features |= CONF_ESLIBPATH; } #if defined(__sparc) && !defined(_ELF64) if (head->ch_adlibpath) { str = (const char *)(head->ch_adlibpath + addr); if (expand_paths(lmp, str, &aout_def_dirs, AL_CNT_SEARCH, - (LA_SER_DEFAULT | LA_SER_CONFIG), PD_TKN_CAP) != NULL) + (LA_SER_DEFAULT | LA_SER_CONFIG), PD_TKN_CAP) != 0) features |= CONF_ADLIBPATH; } if (head->ch_aslibpath) { str = (const char *)(head->ch_aslibpath + addr); if (expand_paths(lmp, str, &aout_sec_dirs, AL_CNT_SEARCH, - (LA_SER_SECURE | LA_SER_CONFIG), PD_TKN_CAP) != NULL) + (LA_SER_SECURE | LA_SER_CONFIG), PD_TKN_CAP) != 0) features |= CONF_ASLIBPATH; } #endif diff --git a/usr/src/cmd/sgs/rtld/common/dlfcns.c b/usr/src/cmd/sgs/rtld/common/dlfcns.c index 74432c1686..1c980860d5 100644 --- a/usr/src/cmd/sgs/rtld/common/dlfcns.c +++ b/usr/src/cmd/sgs/rtld/common/dlfcns.c @@ -745,7 +745,7 @@ dlmopen_core(Lm_list *lml, Lm_list *olml, const char *path, int mode, * provides flexibility should we be able to support dlopening more * than one object in the future. */ - if (LM_FIX_NAME(clmp)(path, clmp, &palp, AL_CNT_NEEDED, orig) == NULL) + if (LM_FIX_NAME(clmp)(path, clmp, &palp, AL_CNT_NEEDED, orig) == 0) return (NULL); if ((palp->al_arritems > 1) && ((mode & RTLD_FIRST) == 0)) { @@ -758,7 +758,7 @@ dlmopen_core(Lm_list *lml, Lm_list *olml, const char *path, int mode, * Establish a link-map control list for this request, and load the * associated object. */ - if ((nlmco = create_cntl(lml, 1)) == NULL) { + if ((nlmco = create_cntl(lml, 1)) == 0) { remove_alist(&palp, 1); return (NULL); } @@ -866,7 +866,7 @@ dlmopen_intn(Lm_list *lml, const char *path, int mode, Rt_map *clmp, * * LM_ID_BASE: Operate on the PRIMARY (executables) link map * LM_ID_LDSO: Operation on ld.so.1's link map - * LM_ID_NEWLM: Create a new link-map. + * LM_ID_NEWLM: Create a new link-map. */ if (lml == (Lm_list *)LM_ID_NEWLM) { if ((lml = calloc(sizeof (Lm_list), 1)) == NULL) @@ -2268,7 +2268,7 @@ dlinfo(void *handle, int request, void *p) * incrementing a pointer. Hence, alist additions that occur * in mid-traverse will not cause confusion. * - * There is one limitation: We cannot continue operation if an object + * There is one limitation: We cannot continue operation if an object * is removed from the process from within a callback. We detect when * this happens and return immediately with a -1 return value. * diff --git a/usr/src/cmd/sgs/rtld/common/elf.c b/usr/src/cmd/sgs/rtld/common/elf.c index a3600fddbe..ff89028c38 100644 --- a/usr/src/cmd/sgs/rtld/common/elf.c +++ b/usr/src/cmd/sgs/rtld/common/elf.c @@ -315,12 +315,12 @@ elf_verify(caddr_t addr, size_t size, Fdesc *fdp, const char *name, * * - elf_needed() is called to establish any ld.so.1 dependencies. These * dependencies should all be lazy loaded, so this routine is typically a - * no-op. However, we call elf_needed() for completeness, in case any + * no-op. However, we call elf_needed() for completeness, in case any * NEEDED initialization is required. * * - For intel, ld.so.1's JMPSLOT relocations need relative updates. These * are by default skipped thus delaying all relative relocation processing - * on every invocation of ld.so.1. + * on every invocation of ld.so.1. */ int elf_rtld_load() @@ -344,7 +344,7 @@ elf_rtld_load() * * - ld.so.1 does not exercise *any* PLT's before it has made a call * to elf_lazy_load(). This is because all dynamic dependencies - * are recorded as lazy dependencies. + * are recorded as lazy dependencies. */ (void) elf_reloc_relative_count((ulong_t)JMPREL(lmp), (ulong_t)(PLTRELSZ(lmp) / RELENT(lmp)), (ulong_t)RELENT(lmp), @@ -422,7 +422,7 @@ elf_lazy_load(Rt_map *clmp, Slookup *slp, uint_t ndx, const char *sym, /* * Establish a link-map control list for this request. */ - if ((lmco = create_cntl(lml, 0)) == NULL) { + if ((lmco = create_cntl(lml, 0)) == 0) { remove_alist(&palp, 1); return (NULL); } @@ -838,7 +838,7 @@ _elf_lookup_filtee(Slookup *slp, Sresult *srp, uint_t *binfo, uint_t ndx, (LML_FLG_TRC_UNREF | LML_FLG_TRC_UNUSED)); if (tracing || DBG_ENABLED) { - Bnd_desc *bdp; + Bnd_desc *bdp; Aliste idx; FLAGS1(ilmp) |= FL1_RT_USED; @@ -924,8 +924,8 @@ _elf_lookup_filtee(Slookup *slp, Sresult *srp, uint_t *binfo, uint_t ndx, /* * Establish a link-map control list for this request. */ - if ((lmco = create_cntl(lml, 0)) == NULL) - return (NULL); + if ((lmco = create_cntl(lml, 0)) == 0) + return (0); /* * Determine the capability filtees. If none can be @@ -1016,7 +1016,7 @@ _elf_lookup_filtee(Slookup *slp, Sresult *srp, uint_t *binfo, uint_t ndx, * - ld.so.1 is available to relocate * against. * - There's no need to add an dependencies - * to this handle. + * to this handle. */ rdflags = (GPD_DLSYM | GPD_RELOC); @@ -1070,8 +1070,8 @@ _elf_lookup_filtee(Slookup *slp, Sresult *srp, uint_t *binfo, uint_t ndx, * Establish a link-map control list for this * request. */ - if ((lmco = create_cntl(lml, 0)) == NULL) - return (NULL); + if ((lmco = create_cntl(lml, 0)) == 0) + return (0); /* * Locate and load the filtee. @@ -1874,13 +1874,13 @@ elf_new_lmp(Lm_list *lml, Aliste lmco, Fdesc *fdp, Addr addr, size_t msize, JMPREL(lmp) = (void *)(dyn->d_un.d_ptr + base); break; case DT_INIT: - if (dyn->d_un.d_ptr != NULL) + if (dyn->d_un.d_ptr != 0) INIT(lmp) = (void (*)())(dyn->d_un.d_ptr + base); break; case DT_FINI: - if (dyn->d_un.d_ptr != NULL) + if (dyn->d_un.d_ptr != 0) FINI(lmp) = (void (*)())(dyn->d_un.d_ptr + base); @@ -2510,7 +2510,7 @@ elf_dladdr(ulong_t addr, Rt_map *lmp, Dl_info *dlip, void **info, int flags) * symbol lookup hash table. */ str = STRTAB(lmp); - if (SUNWSYMSZ(lmp) == NULL) { + if (SUNWSYMSZ(lmp) == 0) { sym = SYMTAB(lmp); /* * If we don't have a .hash table there are no symbols @@ -2720,7 +2720,7 @@ elf_lazy_find_sym(Slookup *slp, Sresult *srp, uint_t *binfo, int *in_nfavl) * as each object supplies its own lazy dependencies. */ if (aplist_append(&alist, lmp, AL_CNT_LAZYFIND) == NULL) - return (NULL); + return (0); for (APLIST_TRAVERSE(alist, idx1, lmp1)) { uint_t dynndx; @@ -2777,8 +2777,8 @@ elf_lazy_find_sym(Slookup *slp, Sresult *srp, uint_t *binfo, int *in_nfavl) * A successful lazy load can mean one of two things: * * - new objects have been loaded, in which case the - * objects will have been analyzed, relocated, and - * finally moved to the callers control list. + * objects will have been analyzed, relocated, and + * finally moved to the callers control list. * - the objects are already loaded, and this lazy * load has simply associated the referenced object * with it's lazy dependencies. @@ -2860,7 +2860,7 @@ elf_lazy_find_sym(Slookup *slp, Sresult *srp, uint_t *binfo, int *in_nfavl) if (slp->sl_flags & LKUP_NODESCENT) continue; - if (aplist_test(&alist, nlmp, AL_CNT_LAZYFIND) == NULL) + if (aplist_test(&alist, nlmp, AL_CNT_LAZYFIND) == 0) return (0); } } diff --git a/usr/src/cmd/sgs/rtld/common/external.c b/usr/src/cmd/sgs/rtld/common/external.c index 2476a6dbbc..caade06cf1 100644 --- a/usr/src/cmd/sgs/rtld/common/external.c +++ b/usr/src/cmd/sgs/rtld/common/external.c @@ -368,9 +368,9 @@ get_lcinterface(Rt_map *lmp, Lc_interface *funcs) * If a version of libc gives us only a subset of the TLS * interfaces, it's confused and we discard the whole lot. */ - if ((lcp[CI_TLS_MODADD].lc_un.lc_func && - lcp[CI_TLS_MODREM].lc_un.lc_func && - lcp[CI_TLS_STATMOD].lc_un.lc_func) == NULL) { + if (((lcp[CI_TLS_MODADD].lc_un.lc_func != NULL) && + (lcp[CI_TLS_MODREM].lc_un.lc_func != NULL) && + (lcp[CI_TLS_STATMOD].lc_un.lc_func != NULL)) == 0) { lcp[CI_TLS_MODADD].lc_un.lc_func = NULL; lcp[CI_TLS_MODREM].lc_un.lc_func = NULL; lcp[CI_TLS_STATMOD].lc_un.lc_func = NULL; diff --git a/usr/src/cmd/sgs/rtld/common/object.c b/usr/src/cmd/sgs/rtld/common/object.c index 0b00292e83..31cc6b4c64 100644 --- a/usr/src/cmd/sgs/rtld/common/object.c +++ b/usr/src/cmd/sgs/rtld/common/object.c @@ -261,7 +261,7 @@ elf_obj_fini(Lm_list *lml, Rt_map *lmp, Rt_map *clmp, int *in_nfavl) * capabilities have been established, ensure that they are appropriate * for this system. */ - if (pnavl_recorded(&capavl, ofl->ofl_name, NULL, NULL)) + if (pnavl_recorded(&capavl, ofl->ofl_name, 0, NULL)) scapset = alt_scapset; else scapset = org_scapset; diff --git a/usr/src/cmd/sgs/rtld/common/util.c b/usr/src/cmd/sgs/rtld/common/util.c index f10f7a4aed..ebdd9e1943 100644 --- a/usr/src/cmd/sgs/rtld/common/util.c +++ b/usr/src/cmd/sgs/rtld/common/util.c @@ -1324,7 +1324,7 @@ create_cntl(Lm_list *lml, int dlopen) if ((lmc = alist_append(&lml->lm_lists, NULL, sizeof (Lm_cntl), AL_CNT_LMLISTS)) == NULL) - return (NULL); + return (0); return ((Aliste)((char *)lmc - (char *)lml->lm_lists)); } @@ -2006,7 +2006,7 @@ ld_generic_env(const char *s1, size_t len, const char *s2, Word *lmflags, } else if (select & SEL_ACT_SPEC_2) { /* * variables can be: ENV_FLG_ - * AUDIT_ARGS, BINDING, CONFGEN, LOADFLTR, PROFILE, + * AUDIT_ARGS, BINDING, CONFGEN, LOADFLTR, PROFILE, * SIGNAL, TRACE_OBJS */ switch (variable) { @@ -2863,7 +2863,7 @@ int printf(const char *format, ...) { va_list args; - char buffer[ERRSIZE]; + char buffer[ERRSIZE]; Prfbuf prf; va_start(args, format); diff --git a/usr/src/cmd/sgs/rtld/mdbmod/common/rtld.c b/usr/src/cmd/sgs/rtld/mdbmod/common/rtld.c index 679dabb628..9cd990cf23 100644 --- a/usr/src/cmd/sgs/rtld/mdbmod/common/rtld.c +++ b/usr/src/cmd/sgs/rtld/mdbmod/common/rtld.c @@ -502,7 +502,7 @@ rtmap_format(uintptr_t addr, const void *data, void *private) if (wdp && (wdp->w_flags & RTLD_FLG_VERBOSE)) { mdb_printf(MSG_ORIG(MSG_STR_DASHES)); (void) mdb_call_dcmd( - MSG_ORIG(MSG_RTMAP_STR), addr, DCMD_ADDRSPEC, NULL, NULL); + MSG_ORIG(MSG_RTMAP_STR), addr, DCMD_ADDRSPEC, 0, NULL); return (0); } @@ -679,7 +679,7 @@ dcmd_Setenv(uintptr_t addr, uint_t flags, int argc, const mdb_arg_t *argv) static int walk_rtmap_init(mdb_walk_state_t *wsp) { - if (wsp->walk_addr == NULL) { + if (wsp->walk_addr == 0) { mdb_warn(MSG_ORIG(MSG_ERR_NAS), MSG_ORIG(MSG_RTMAP_STR)); return (WALK_ERR); } @@ -692,7 +692,7 @@ walk_rtmap_step(mdb_walk_state_t *wsp) int status; Rt_map lmp; - if (wsp->walk_addr == NULL) + if (wsp->walk_addr == 0) return (WALK_DONE); if (mdb_vread(&lmp, sizeof (Rt_map), wsp->walk_addr) == -1) { mdb_warn(MSG_ORIG(MSG_ERR_READ), diff --git a/usr/src/cmd/svc/startd/graph.c b/usr/src/cmd/svc/startd/graph.c index 0361d5ae4f..452d91250e 100644 --- a/usr/src/cmd/svc/startd/graph.c +++ b/usr/src/cmd/svc/startd/graph.c @@ -3563,7 +3563,7 @@ do_uadmin(void) char *fbarg = NULL; #endif /* __x86 */ - mdep = NULL; + mdep = 0; fd = creat(resetting, 0777); if (fd >= 0) startd_close(fd); diff --git a/usr/src/cmd/svc/startd/method.c b/usr/src/cmd/svc/startd/method.c index 915ad42da6..2629b74210 100644 --- a/usr/src/cmd/svc/startd/method.c +++ b/usr/src/cmd/svc/startd/method.c @@ -963,7 +963,7 @@ method_run(restarter_inst_t **instp, int type, int *exit_code) MUTEX_UNLOCK(&inst->ri_lock); do { - r = waitpid(pid, &ret_status, NULL); + r = waitpid(pid, &ret_status, 0); } while (r == -1 && errno == EINTR); if (r == -1) err = errno; diff --git a/usr/src/cmd/svc/startd/protocol.c b/usr/src/cmd/svc/startd/protocol.c index 009fe8c195..e4fc9f73c5 100644 --- a/usr/src/cmd/svc/startd/protocol.c +++ b/usr/src/cmd/svc/startd/protocol.c @@ -89,7 +89,7 @@ graph_protocol_init() (void) pthread_mutex_init(&graph_queue->gpeq_lock, &mutex_attrs); graph_queue->gpeq_event_list = startd_list_create( - graph_protocol_event_queue_pool, graph_queue, NULL); + graph_protocol_event_queue_pool, graph_queue, 0); } /* @@ -204,7 +204,7 @@ restarter_protocol_init() (void) pthread_mutex_init(&restarter_queue->rpeq_lock, &mutex_attrs); restarter_queue->rpeq_event_list = startd_list_create( - restarter_protocol_event_queue_pool, restarter_queue, NULL); + restarter_protocol_event_queue_pool, restarter_queue, 0); log_framework(LOG_DEBUG, "Initialized restarter protocol\n"); } @@ -382,11 +382,11 @@ restarter_protocol_init_delegate(char *fmri) /* * The following errors can be returned in this * case : - * EINVAL : inappropriate flags or dump flag - * and the dump failed. - * EEXIST : svc.startd already has a channel - * named as the master channel name - * ENOMEM : too many subscribers to the channel + * EINVAL : inappropriate flags or dump flag + * and the dump failed. + * EEXIST : svc.startd already has a channel + * named as the master channel name + * ENOMEM : too many subscribers to the channel */ uu_warn("Failed to subscribe to restarter %s, channel %s with " "subscriber id %s : \n", fmri, master_channel_name, sid); diff --git a/usr/src/cmd/svc/startd/restarter.c b/usr/src/cmd/svc/startd/restarter.c index a98c863fb5..7ed65aab6a 100644 --- a/usr/src/cmd/svc/startd/restarter.c +++ b/usr/src/cmd/svc/startd/restarter.c @@ -1738,7 +1738,7 @@ rep_retry: info->sf_id = rip->ri_id; info->sf_method_type = METHOD_REFRESH; info->sf_event_type = RERR_REFRESH; - info->sf_reason = NULL; + info->sf_reason = 0; assert(rip->ri_method_thread == 0); rip->ri_method_thread = diff --git a/usr/src/cmd/svc/startd/startd.c b/usr/src/cmd/svc/startd/startd.c index c5307879e2..d28687e761 100644 --- a/usr/src/cmd/svc/startd/startd.c +++ b/usr/src/cmd/svc/startd/startd.c @@ -597,7 +597,7 @@ timestamp: /* Read reconfigure property for recovery. */ if (scf_handle_decode_fmri(hndl, startd_reconfigure_fmri, NULL, NULL, - NULL, NULL, prop, NULL) != -1 && + NULL, NULL, prop, 0) != -1 && scf_property_get_value(prop, val) == 0) (void) scf_value_get_boolean(val, &prop_reconfig); |
