summaryrefslogtreecommitdiff
path: root/usr/src
diff options
context:
space:
mode:
authorJerry Jelinek <jerry.jelinek@joyent.com>2020-01-28 11:39:18 +0000
committerJerry Jelinek <jerry.jelinek@joyent.com>2020-01-28 11:39:18 +0000
commitee930d2f04dcbdb046103cf48945c9e0643f47d7 (patch)
tree61754277baa7c850dd10964ef3c9e0712d831de4 /usr/src
parent531f6e0494c75ea1e5b1f86f5dc336587440f0c5 (diff)
parent881f4659ab3a3d7bac3274ca7320c076fcd007de (diff)
downloadillumos-joyent-ee930d2f04dcbdb046103cf48945c9e0643f47d7.tar.gz
[illumos-gate merge]
commit 881f4659ab3a3d7bac3274ca7320c076fcd007de 12250 zonestat_usage(): stderr vs. stdio dilemma commit ecaa37affc4da0ba0f1331de875432d68cf70a80 12201 Enable smatch for zonestat and zonestatd
Diffstat (limited to 'usr/src')
-rw-r--r--usr/src/cmd/zonestat/zonestat/Makefile5
-rw-r--r--usr/src/cmd/zonestat/zonestat/zonestat.c8
-rw-r--r--usr/src/cmd/zonestat/zonestatd/Makefile11
3 files changed, 9 insertions, 15 deletions
diff --git a/usr/src/cmd/zonestat/zonestat/Makefile b/usr/src/cmd/zonestat/zonestat/Makefile
index a8b62f65d3..96bc8c5e5e 100644
--- a/usr/src/cmd/zonestat/zonestat/Makefile
+++ b/usr/src/cmd/zonestat/zonestat/Makefile
@@ -29,14 +29,11 @@ OBJS = $(SRCS:%.c=%.o)
include ../../Makefile.cmd
-LDLIBS += -lscf -lzonestat -lumem
+LDLIBS += -lscf -lzonestat -lumem
LINTFLAGS += -u
CERRWARN += $(CNOWARN_UNINIT)
-# not linted
-SMATCH=off
-
.KEEP_STATE:
.PARALLEL:
diff --git a/usr/src/cmd/zonestat/zonestat/zonestat.c b/usr/src/cmd/zonestat/zonestat/zonestat.c
index b66612ee10..358c31c4fa 100644
--- a/usr/src/cmd/zonestat/zonestat/zonestat.c
+++ b/usr/src/cmd/zonestat/zonestat/zonestat.c
@@ -292,7 +292,7 @@ zonestat_usage(boolean_t explicit)
" Name of a zone using dedicated-cpu\n"),
"-z", "-n",
ZONESTAT_NAME_MEM_DEFAULT, ZONESTAT_NAME_VM_DEFAULT);
- (void) printf(gettext(
+ (void) fprintf(fd, gettext(
" %s Print timestamp. Valid timestamps are:\n"
" \"%s\"\tDate as specifed by date(1) command\n"
" \"%s\"\tUnix time as returned by time(2)\n"
@@ -309,7 +309,7 @@ zonestat_usage(boolean_t explicit)
ZONESTAT_NAME_HIGH,
"-q", "-p");
- (void) printf(gettext(
+ (void) fprintf(fd, gettext(
" %s Select desired lines in parseable output.\n"
" \"%s\"\tLines describing each resource\n"
" \"%s\"\tTotal usage of each resource\n"
@@ -319,7 +319,7 @@ zonestat_usage(boolean_t explicit)
"-P", ZONESTAT_NAME_RESOURCE, ZONESTAT_NAME_TOTAL,
ZONESTAT_NAME_SYSTEM, ZONESTAT_NAME_ZONES, ZONESTAT_NAME_HEADER);
- (void) printf(gettext(
+ (void) fprintf(fd, gettext(
" %s Sort output by the specified columns:\n"
" \"%s\"\tby name alphanumerically\n"
" \"%s\"\tby percent of resource used\n"
@@ -2358,7 +2358,7 @@ main(int argc, char *argv[])
}
}
- if (opt_line_any & (!opt_parseable)) {
+ if (opt_line_any && (!opt_parseable)) {
(void) zonestat_error(gettext("-P requires -p"));
return (zonestat_usage(B_FALSE));
}
diff --git a/usr/src/cmd/zonestat/zonestatd/Makefile b/usr/src/cmd/zonestat/zonestatd/Makefile
index 727c71148c..de4b2fc4b6 100644
--- a/usr/src/cmd/zonestat/zonestatd/Makefile
+++ b/usr/src/cmd/zonestat/zonestatd/Makefile
@@ -35,16 +35,13 @@ ROOTMANIFESTDIR = $(ROOTSVCSYSTEM)
SRCS = zonestatd.c
CPPFLAGS += -I$(ADJUNCT_PROTO)/usr/include/libxml2
-LDLIBS += -lkstat -lpool -lexacct -lscf \
+LDLIBS += -lkstat -lpool -lexacct -lscf \
-lcontract -lcmdutils -lumem
LINTFLAGS += -u
-CERRWARN += -_gcc=-Wno-parentheses
-CERRWARN += -_gcc=-Wno-unused-label
-CERRWARN += $(CNOWARN_UNINIT)
-
-# not linted
-SMATCH=off
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-unused-label
+CERRWARN += $(CNOWARN_UNINIT)
OBJS = $(SRCS:%.c=%.o)