summaryrefslogtreecommitdiffstats
path: root/usr.bin
diff options
context:
space:
mode:
authormelifaro <melifaro@FreeBSD.org>2013-02-20 14:19:09 +0000
committermelifaro <melifaro@FreeBSD.org>2013-02-20 14:19:09 +0000
commitc00d15a4dde2c54b90438648342d1c185b81b1c3 (patch)
tree27efac7ce049d49155fb99f4ab88ada12678904b /usr.bin
parentb2d5be799f731eeab9d93a1b28efaa3077bd5928 (diff)
downloadFreeBSD-src-c00d15a4dde2c54b90438648342d1c185b81b1c3.zip
FreeBSD-src-c00d15a4dde2c54b90438648342d1c185b81b1c3.tar.gz
Fix several new & old style issues.
Pointed by: ae, pluknet, zont MFC with: r247036
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/systat/ifcmds.c6
-rw-r--r--usr.bin/systat/ifstat.c18
-rw-r--r--usr.bin/systat/systat.12
3 files changed, 12 insertions, 14 deletions
diff --git a/usr.bin/systat/ifcmds.c b/usr.bin/systat/ifcmds.c
index 6e6f1d2..101c939 100644
--- a/usr.bin/systat/ifcmds.c
+++ b/usr.bin/systat/ifcmds.c
@@ -59,16 +59,14 @@ ifcmd(const char *cmd, const char *args)
} else if (prefix(cmd, "match")) {
if (args != NULL && *args != '\0' && memcmp(args, "*", 2) != 0) {
/* We got a valid match line */
- if (matchline != NULL) {
+ if (matchline != NULL)
free(matchline);
- }
needsort = 1;
matchline = strdup(args);
} else {
/* Empty or * pattern, turn filtering off */
- if (matchline != NULL) {
+ if (matchline != NULL)
free(matchline);
- }
needsort = 1;
matchline = NULL;
}
diff --git a/usr.bin/systat/ifstat.c b/usr.bin/systat/ifstat.c
index 6bf588c..1632890 100644
--- a/usr.bin/systat/ifstat.c
+++ b/usr.bin/systat/ifstat.c
@@ -230,7 +230,7 @@ initifstat(void)
n = getifnum();
if (n <= 0)
- return -1;
+ return (-1);
SLIST_INIT(&curlist);
@@ -254,7 +254,7 @@ initifstat(void)
sort_interface_list();
- return 1;
+ return (1);
}
void
@@ -372,9 +372,9 @@ check_match(const char *ifname)
char *p = matchline, *c, t;
int match = 0, mlen;
- if (matchline == NULL) {
- return 0;
- }
+ if (matchline == NULL)
+ return (0);
+
/* Strip leading whitespaces */
while (*p == ' ')
p ++;
@@ -387,7 +387,7 @@ check_match(const char *ifname)
*p = '\0';
if (fnmatch(c, ifname, FNM_CASEFOLD) == 0) {
*p = t;
- return 1;
+ return (1);
}
*p = t;
c = p + strspn(p, " ;,");
@@ -397,7 +397,7 @@ check_match(const char *ifname)
}
}
- return match;
+ return (match);
}
/*
@@ -447,7 +447,7 @@ getifnum(void)
if (sysctl(name, 5, (void *)&data, (size_t *)&datalen, (void *)NULL,
(size_t)0) != 0)
IFSTAT_ERR(1, "sysctl error");
- return data;
+ return (data);
}
static void
@@ -485,5 +485,5 @@ cmdifstat(const char *cmd, const char *args)
}
}
- return retval;
+ return (retval);
}
diff --git a/usr.bin/systat/systat.1 b/usr.bin/systat/systat.1
index 7637673..fa8f789 100644
--- a/usr.bin/systat/systat.1
+++ b/usr.bin/systat/systat.1
@@ -28,7 +28,7 @@
.\" @(#)systat.1 8.2 (Berkeley) 12/30/93
.\" $FreeBSD$
.\"
-.Dd September 17, 2012
+.Dd February 20, 2013
.Dt SYSTAT 1
.Os
.Sh NAME
OpenPOWER on IntegriCloud