diff options
author | Richard Lowe <richlowe@richlowe.net> | 2013-01-27 03:02:37 +0000 |
---|---|---|
committer | Richard Lowe <richlowe@richlowe.net> | 2013-01-27 12:11:32 -0500 |
commit | e633f2d79475b51f0a4d46972282225abf851733 (patch) | |
tree | 905685af0461e555f0f96af856661643a03c3246 /usr | |
parent | 66448911ac89c254e89afc52e114402115a497e3 (diff) | |
download | illumos-gate-e633f2d79475b51f0a4d46972282225abf851733.tar.gz |
749 "/usr/bin/kstat" should be rewritten in C (fix SPARC build)
Diffstat (limited to 'usr')
-rw-r--r-- | usr/src/cmd/stat/kstat/Makefile | 5 | ||||
-rw-r--r-- | usr/src/cmd/stat/kstat/kstat.c | 9 | ||||
-rw-r--r-- | usr/src/cmd/stat/kstat/kstat.h | 2 |
3 files changed, 10 insertions, 6 deletions
diff --git a/usr/src/cmd/stat/kstat/Makefile b/usr/src/cmd/stat/kstat/Makefile index 0fefda6d81..4c072ccd61 100644 --- a/usr/src/cmd/stat/kstat/Makefile +++ b/usr/src/cmd/stat/kstat/Makefile @@ -35,6 +35,11 @@ CFLAGS += $(CCVERBOSE) -I${STATCOMMONDIR} CERRWARN += -_gcc=-Wno-uninitialized CERRWARN += -_gcc=-Wno-switch CERRWARN += -_gcc=-Wno-parentheses + +CPPFLAGS_sparc += -I$(SRC)/uts/sfmmu +CPPFLAGS_sparc += -I$(SRC)/uts/sun4u/sunfire +CPPFLAGS += $(CPPFLAGS_$(MACH)) + FILEMODE= 0555 lint := LINTFLAGS = -muxs -I$(STATCOMMONDIR) diff --git a/usr/src/cmd/stat/kstat/kstat.c b/usr/src/cmd/stat/kstat/kstat.c index ed78340ec2..2165101ac9 100644 --- a/usr/src/cmd/stat/kstat/kstat.c +++ b/usr/src/cmd/stat/kstat/kstat.c @@ -1261,15 +1261,15 @@ short_array_to_string(short *shortp, int len) for (; len > 1; len--, shortp++) { if (list == NULL) { - (void) asprintf(&list_buf, "%d,", *shortp); + (void) asprintf(&list_buf, "%hd,", *shortp); } else { - (void) asprintf(&list_buf, "%s%d,", list, *shortp); + (void) asprintf(&list_buf, "%s%hd,", list, *shortp); free(list); } list = list_buf; } - (void) asprintf(&list_buf, "%s%s", list, *shortp); + (void) asprintf(&list_buf, "%s%hd", list, *shortp); free(list); return (list_buf); } @@ -1279,7 +1279,6 @@ save_temperature(kstat_t *kp, ks_instance_t *ksi) { struct temp_stats *temps = (struct temp_stats *)(kp->ks_data); char *buf; - int n = 1; assert(kp->ks_data_size == sizeof (struct temp_stats)); @@ -1381,7 +1380,7 @@ save_fault_list(kstat_t *kp, ks_instance_t *ksi) (void) snprintf(name, sizeof (name), "create_time_%d", i); SAVE_HRTIME_X(ksi, name, fault->create_time); (void) snprintf(name, sizeof (name), "msg_%d", i); - SAVE_STRING_X(ksi, name, faultp->msg); + SAVE_STRING_X(ksi, name, fault->msg); } } #endif diff --git a/usr/src/cmd/stat/kstat/kstat.h b/usr/src/cmd/stat/kstat/kstat.h index dfbfd7d1c2..dcad921737 100644 --- a/usr/src/cmd/stat/kstat/kstat.h +++ b/usr/src/cmd/stat/kstat/kstat.h @@ -150,7 +150,7 @@ typedef union ks_value { #define SAVE_CHAR_X(I, N, V) \ { \ ks_value_t v; \ - asprintf(&v.str.addr.ptr, "%c", V); \ + (void) asprintf(&v.str.addr.ptr, "%c", V); \ v.str.len = 1; \ nvpair_insert(I, N, &v, KSTAT_DATA_STRING); \ } |