aboutsummaryrefslogtreecommitdiff
path: root/sys/vm
diff options
context:
space:
mode:
authorDag-Erling Smørgrav <des@FreeBSD.org>2001-02-22 14:44:39 +0000
committerDag-Erling Smørgrav <des@FreeBSD.org>2001-02-22 14:44:39 +0000
commit2f9564de0fdc19faee5fc38713f35813807c2b48 (patch)
tree0c49e54c6df41c967a3af4266e5393f9a3c3572d /sys/vm
parent3cf714fef8721dd138916ff001b896d1a71fecf5 (diff)
downloadsrc-2f9564de0fdc19faee5fc38713f35813807c2b48.tar.gz
src-2f9564de0fdc19faee5fc38713f35813807c2b48.zip
Fix formatting bugs introduced in sysctl_vm_zone() by the previous commit.
Also, if SYSCTL_OUT() returns a non-zero value, stop at once.
Notes
Notes: svn path=/head/; revision=72888
Diffstat (limited to 'sys/vm')
-rw-r--r--sys/vm/vm_zone.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/sys/vm/vm_zone.c b/sys/vm/vm_zone.c
index f2d9622577a0..65c10deac9f0 100644
--- a/sys/vm/vm_zone.c
+++ b/sys/vm/vm_zone.c
@@ -417,6 +417,7 @@ sysctl_vm_zone(SYSCTL_HANDLER_ARGS)
int error, len;
char tmpbuf[128];
vm_zone_t z;
+ char *p;
mtx_lock(&zone_mtx);
len = snprintf(tmpbuf, sizeof(tmpbuf),
@@ -425,13 +426,17 @@ sysctl_vm_zone(SYSCTL_HANDLER_ARGS)
SLIST_FOREACH(z, &zlist, zent) {
mtx_lock(&z->zmtx);
len = snprintf(tmpbuf, sizeof(tmpbuf),
- "%-14.14s %6.6u, %8.8u, %6.6u, %6.6u, %8.8u\n",
+ "%-12.12s %6.6u, %8.8u, %6.6u, %6.6u, %8.8u\n",
z->zname, z->zsize, z->zmax, (z->ztotal - z->zfreecnt),
z->zfreecnt, z->znalloc);
+ for (p = tmpbuf + 12; p > tmpbuf && *p == ' '; --p)
+ /* nothing */ ;
+ p[1] = ':';
mtx_unlock(&z->zmtx);
if (SLIST_NEXT(z, zent) == NULL)
tmpbuf[len - 1] = 0;
- error = SYSCTL_OUT(req, tmpbuf, len);
+ if ((error = SYSCTL_OUT(req, tmpbuf, len)) != 0)
+ break;
}
mtx_unlock(&zone_mtx);
return (error);