Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F115928619
D38172.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D38172.diff
View Options
diff --git a/usr.bin/w/w.c b/usr.bin/w/w.c
--- a/usr.bin/w/w.c
+++ b/usr.bin/w/w.c
@@ -67,7 +67,6 @@
#include <arpa/nameser.h>
#include <ctype.h>
-#include <err.h>
#include <errno.h>
#include <fcntl.h>
#include <kvm.h>
@@ -189,7 +188,7 @@
nflag += 1;
break;
case 'f': case 'l': case 's': case 'u': case 'w':
- warnx("-%c no longer supported", ch);
+ xo_warnx("-%c no longer supported", ch);
/* FALLTHROUGH */
case '?':
default:
@@ -204,7 +203,7 @@
_res.retry = 1; /* only try once.. */
if ((kd = kvm_openfiles(nlistf, memf, NULL, O_RDONLY, errbuf)) == NULL)
- errx(1, "%s", errbuf);
+ xo_errx(1, "%s", errbuf);
(void)time(&now);
@@ -239,7 +238,7 @@
continue;
}
if ((ep = calloc(1, sizeof(struct entry))) == NULL)
- errx(1, "calloc");
+ xo_errx(1, "calloc");
*nextp = ep;
nextp = &ep->next;
memmove(&ep->utmp, utmp, sizeof *utmp);
@@ -338,7 +337,8 @@
pr_header(&now, nusers);
if (wcmd == 0) {
xo_close_container("uptime-information");
- xo_finish();
+ if (xo_finish() < 0)
+ xo_err(1, "stdout");
(void)kvm_close(kd);
exit(0);
}
@@ -351,7 +351,7 @@
}
if ((kp = kvm_getprocs(kd, KERN_PROC_ALL, 0, &nentries)) == NULL)
- err(1, "%s", kvm_geterr(kd));
+ xo_err(1, "%s", kvm_geterr(kd));
for (i = 0; i < nentries; i++, kp++) {
if (kp->ki_stat == SIDL || kp->ki_stat == SZOMB ||
kp->ki_tdev == NODEV)
@@ -400,7 +400,7 @@
ep->args = fmt_argv(kvm_getargv(kd, ep->kp, argwidth),
ep->kp->ki_comm, NULL, MAXCOMLEN);
if (ep->args == NULL)
- err(1, NULL);
+ xo_err(1, NULL);
}
/* sort by idle time */
if (sortidle && ehead != NULL) {
@@ -472,7 +472,8 @@
xo_close_list("user-entry");
xo_close_container("user-table");
xo_close_container("uptime-information");
- xo_finish();
+ if (xo_finish() < 0)
+ xo_err(1, "stdout");
(void)kvm_close(kd);
exit(0);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, May 1, 1:06 PM (18 h, 46 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
17880233
Default Alt Text
D38172.diff (1 KB)
Attached To
Mode
D38172: w: Complete libxo transition.
Attached
Detach File
Event Timeline
Log In to Comment