Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F153893158
D41432.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D41432.diff
View Options
diff --git a/usr.bin/vmstat/vmstat.c b/usr.bin/vmstat/vmstat.c
--- a/usr.bin/vmstat/vmstat.c
+++ b/usr.bin/vmstat/vmstat.c
@@ -49,7 +49,6 @@
#include <ctype.h>
#include <devstat.h>
-#include <err.h>
#include <errno.h>
#include <inttypes.h>
#include <kvm.h>
@@ -338,8 +337,9 @@
xo_error("undefined symbols:\n", buf);
} else
xo_warnx("kvm_nlist: %s", kvm_geterr(kd));
- xo_finish();
- exit(1);
+ if (xo_finish() < 0)
+ xo_err(EXIT_FAILURE, "stdout");
+ exit(EXIT_FAILURE);
}
nlist_ok:
if (kd && Pflag)
@@ -386,8 +386,9 @@
if (todo & VMSTAT)
dovmstat(interval, reps);
xo_close_container("vmstat");
- xo_finish();
- exit(0);
+ if (xo_finish() < 0)
+ xo_err(EXIT_FAILURE, "stdout");
+ exit(EXIT_SUCCESS);
}
static int
@@ -796,7 +797,8 @@
else
cpustats();
xo_emit("\n");
- xo_flush();
+ if (xo_flush() < 0)
+ xo_err(EXIT_FAILURE, "stdout");
if (reps >= 0 && --reps <= 0)
break;
osum = sum;
@@ -1192,7 +1194,7 @@
if (kd != NULL) {
kread(X_SINTRCNT, &intrcntlen, sizeof(intrcntlen));
if ((*intrcnts = malloc(intrcntlen)) == NULL)
- err(1, "malloc()");
+ xo_err(1, "malloc()");
if (namelist[X_NINTRCNT].n_type == 0)
kread(X_INTRCNT, *intrcnts, intrcntlen);
else {
@@ -1203,7 +1205,7 @@
for (*intrcnts = NULL, intrcntlen = 1024; ; intrcntlen *= 2) {
*intrcnts = reallocf(*intrcnts, intrcntlen);
if (*intrcnts == NULL)
- err(1, "reallocf()");
+ xo_err(1, "reallocf()");
if (mysysctl("hw.intrcnt", *intrcnts, &intrcntlen) == 0)
break;
}
@@ -1311,7 +1313,8 @@
print_intrcnts(intrcnts, old_intrcnts, intrnames, nintr,
istrnamlen, period_ms);
- xo_flush();
+ if (xo_flush() < 0)
+ xo_err(EXIT_FAILURE, "stdout");
free(old_intrcnts);
old_intrcnts = intrcnts;
@@ -1616,6 +1619,7 @@
xo_error("%s%s",
"usage: vmstat [-afHhimoPsz] [-M core [-N system]] [-c count] [-n devs]\n",
" [-p type,if,pass] [-w wait] [disks] [wait [count]]\n");
- xo_finish();
- exit(1);
+ if (xo_finish() < 0)
+ xo_err(EXIT_FAILURE, "stdout");
+ exit(EXIT_FAILURE);
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Apr 25, 2:20 PM (12 h, 23 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
32129548
Default Alt Text
D41432.diff (2 KB)
Attached To
Mode
D41432: vmstat: Complete libxo transition.
Attached
Detach File
Event Timeline
Log In to Comment