aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/systat
diff options
context:
space:
mode:
authorSimon J. Gerraty <sjg@FreeBSD.org>2014-04-28 07:50:45 +0000
committerSimon J. Gerraty <sjg@FreeBSD.org>2014-04-28 07:50:45 +0000
commit3b8f08459569bf0faa21473e5cec2491e95c9349 (patch)
tree80f45dd81ca716bcd7ca9674581e1fc40b93cd34 /usr.bin/systat
parent9d2ab4a62d6733c45958627ac113bdbd818d1e2a (diff)
parentb2ba55951383498f252746f618d513139da06e8e (diff)
Notes
Diffstat (limited to 'usr.bin/systat')
-rw-r--r--usr.bin/systat/Makefile13
-rw-r--r--usr.bin/systat/main.c4
-rw-r--r--usr.bin/systat/netcmds.c2
3 files changed, 16 insertions, 3 deletions
diff --git a/usr.bin/systat/Makefile b/usr.bin/systat/Makefile
index 40d55cc7e0be..5773c36adf2d 100644
--- a/usr.bin/systat/Makefile
+++ b/usr.bin/systat/Makefile
@@ -16,7 +16,16 @@ CFLAGS+= -DINET6
WARNS?= 0
-DPADD= ${LIBNCURSESW} ${LIBM} ${LIBDEVSTAT} ${LIBKVM}
-LDADD= -lncursesw -lm -ldevstat -lkvm
+DPADD= ${LIBM} ${LIBDEVSTAT} ${LIBKVM}
+LDADD= -lm -ldevstat -lkvm
+
+.if ${MK_NCURSESW} == "no"
+DPADD+= ${LIBNCURSES}
+LDADD+= -lncurses
+.else
+CFLAGS+= -DUSE_WIDECHAR
+DPADD+= ${LIBNCURSESW}
+LDADD+= -lncursesw
+.endif
.include <bsd.prog.mk>
diff --git a/usr.bin/systat/main.c b/usr.bin/systat/main.c
index 1aed28ab4a8a..8417811e222e 100644
--- a/usr.bin/systat/main.c
+++ b/usr.bin/systat/main.c
@@ -84,7 +84,11 @@ main(int argc, char **argv)
size_t size;
double t;
+#ifdef USE_WIDECHAR
(void) setlocale(LC_ALL, "");
+#else
+ (void) setlocale(LC_TIME, "");
+#endif
argc--, argv++;
while (argc > 0) {
diff --git a/usr.bin/systat/netcmds.c b/usr.bin/systat/netcmds.c
index 7ee8f15a2734..f9da13e1667d 100644
--- a/usr.bin/systat/netcmds.c
+++ b/usr.bin/systat/netcmds.c
@@ -152,7 +152,7 @@ changeitems(const char *args, int onoff)
hp = gethostbyname(tmpstr1);
if (hp == 0) {
in.s_addr = inet_addr(tmpstr1);
- if ((int)in.s_addr == -1) {
+ if (in.s_addr == INADDR_NONE) {
error("%s: unknown host or port", tmpstr1);
continue;
}