diff options
author | des <des@FreeBSD.org> | 2001-02-22 14:44:39 +0000 |
---|---|---|
committer | des <des@FreeBSD.org> | 2001-02-22 14:44:39 +0000 |
commit | 8862541dfd4f372cb74e7c40d90370b1d2dc7c73 (patch) | |
tree | 58cf7a08ac7c76076f79ecfdf5653e0271fd45e1 /sys/vm/vm_zone.c | |
parent | 3956d542bf2c23718f12d25e0c4e171a8db27ab8 (diff) | |
download | FreeBSD-src-8862541dfd4f372cb74e7c40d90370b1d2dc7c73.zip FreeBSD-src-8862541dfd4f372cb74e7c40d90370b1d2dc7c73.tar.gz |
Fix formatting bugs introduced in sysctl_vm_zone() by the previous commit.
Also, if SYSCTL_OUT() returns a non-zero value, stop at once.
Diffstat (limited to 'sys/vm/vm_zone.c')
-rw-r--r-- | sys/vm/vm_zone.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/sys/vm/vm_zone.c b/sys/vm/vm_zone.c index f2d9622..65c10de 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); |