summaryrefslogtreecommitdiffstats
path: root/usr.bin/w
diff options
context:
space:
mode:
authorobrien <obrien@FreeBSD.org>2013-02-08 16:10:16 +0000
committerobrien <obrien@FreeBSD.org>2013-02-08 16:10:16 +0000
commit3028e3f8aba938dfd0bf9fda987b8a72140b8027 (patch)
treeb2f038222ff8a70f687652441df00d2b564c8abe /usr.bin/w
parent952a6d5a7cd3d3f9007acfa06805262fc04a105f (diff)
parent1d08d5f677c1dfa810e381073590adbae19cc69f (diff)
downloadFreeBSD-src-3028e3f8aba938dfd0bf9fda987b8a72140b8027.zip
FreeBSD-src-3028e3f8aba938dfd0bf9fda987b8a72140b8027.tar.gz
Sync with HEAD.
Diffstat (limited to 'usr.bin/w')
-rw-r--r--usr.bin/w/extern.h1
-rw-r--r--usr.bin/w/proc_compare.c12
-rw-r--r--usr.bin/w/w.c6
3 files changed, 9 insertions, 10 deletions
diff --git a/usr.bin/w/extern.h b/usr.bin/w/extern.h
index 0e886d0..facc3e8 100644
--- a/usr.bin/w/extern.h
+++ b/usr.bin/w/extern.h
@@ -30,7 +30,6 @@
* $FreeBSD$
*/
-
extern int use_ampm;
struct kinfo_proc;
diff --git a/usr.bin/w/proc_compare.c b/usr.bin/w/proc_compare.c
index 4888386..0e73ba4 100644
--- a/usr.bin/w/proc_compare.c
+++ b/usr.bin/w/proc_compare.c
@@ -62,11 +62,11 @@ __FBSDID("$FreeBSD$");
* TODO - consider whether pctcpu should be used.
*/
-#define ISRUN(p) (((p)->ki_stat == SRUN) || ((p)->ki_stat == SIDL))
-#define TESTAB(a, b) ((a)<<1 | (b))
-#define ONLYA 2
-#define ONLYB 1
-#define BOTH 3
+#define ISRUN(p) (((p)->ki_stat == SRUN) || ((p)->ki_stat == SIDL))
+#define TESTAB(a, b) ((a)<<1 | (b))
+#define ONLYA 2
+#define ONLYB 1
+#define BOTH 3
int
proc_compare(struct kinfo_proc *p1, struct kinfo_proc *p2)
@@ -93,7 +93,7 @@ proc_compare(struct kinfo_proc *p1, struct kinfo_proc *p2)
return (p2->ki_pid > p1->ki_pid); /* tie - return highest pid */
}
/*
- * weed out zombies
+ * weed out zombies
*/
switch (TESTAB(p1->ki_stat == SZOMB, p2->ki_stat == SZOMB)) {
case ONLYA:
diff --git a/usr.bin/w/w.c b/usr.bin/w/w.c
index 2e19bb1..1b9af5f 100644
--- a/usr.bin/w/w.c
+++ b/usr.bin/w/w.c
@@ -123,7 +123,7 @@ static struct stat *ttystat(char *);
static void usage(int);
static int this_is_uptime(const char *s);
-char *fmt_argv(char **, char *, int); /* ../../bin/ps/fmt.c */
+char *fmt_argv(char **, char *, char *, size_t); /* ../../bin/ps/fmt.c */
int
main(int argc, char *argv[])
@@ -320,7 +320,7 @@ main(int argc, char *argv[])
continue;
}
ep->args = fmt_argv(kvm_getargv(kd, ep->kp, argwidth),
- ep->kp->ki_comm, MAXCOMLEN);
+ ep->kp->ki_comm, NULL, MAXCOMLEN);
if (ep->args == NULL)
err(1, NULL);
}
@@ -404,7 +404,7 @@ main(int argc, char *argv[])
const char *ptr;
ptr = fmt_argv(kvm_getargv(kd, dkp, argwidth),
- dkp->ki_comm, MAXCOMLEN);
+ dkp->ki_comm, NULL, MAXCOMLEN);
if (ptr == NULL)
ptr = "-";
(void)printf("\t\t%-9d %s\n",
OpenPOWER on IntegriCloud