aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/w
diff options
context:
space:
mode:
authorsvn2git <svn2git@FreeBSD.org>1994-05-01 08:00:00 +0000
committersvn2git <svn2git@FreeBSD.org>1994-05-01 08:00:00 +0000
commita16f65c7d117419bd266c28a1901ef129a337569 (patch)
tree2626602f66dc3551e7a7c7bc9ad763c3bc7ab40a /usr.bin/w
parent8503f4f13f77abf7adc8f7e329c6f9c1d52b6a20 (diff)
This commit was manufactured to restore the state of the 1.1-RELEASE image. Releases prior to 5.3-RELEASE are omitting the secure/ and crypto/ subdirs.
Diffstat (limited to 'usr.bin/w')
-rw-r--r--usr.bin/w/w.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/usr.bin/w/w.c b/usr.bin/w/w.c
index 44625b05568c..c24b88502b05 100644
--- a/usr.bin/w/w.c
+++ b/usr.bin/w/w.c
@@ -289,11 +289,15 @@ main(argc, argv)
if (argwidth < 4)
argwidth = 8;
for (ep = ehead; ep != NULL; ep = ep->next) {
- ep->args = strdup(kvm_getargs(ep->proc, kvm_getu(ep->proc)));
- if (ep->args == NULL) {
- error("out of memory");
- exit(1);
+ if(ep->proc != NULL) {
+ ep->args = strdup(kvm_getargs(ep->proc, kvm_getu(ep->proc)));
+ if (ep->args == NULL) {
+ error("out of memory");
+ exit(1);
+ }
}
+
+
}
/* sort by idle time */
if (sortidle && ehead != NULL) {
@@ -326,7 +330,10 @@ main(argc, argv)
printf(" - ");
else
prttime(ep->idle, " ");
- printf("%.*s\n", argwidth, ep->args);
+ if(ep->args)
+ printf("%.*s\n", argwidth, ep->args);
+ else
+ printf("-\n");
}
exit(0);
}