From owner-freebsd-current Sun Jul 8 18:11:40 2001 Delivered-To: freebsd-current@freebsd.org Received: from flood.ping.uio.no (flood.ping.uio.no [129.240.78.31]) by hub.freebsd.org (Postfix) with ESMTP id 6683C37B405 for ; Sun, 8 Jul 2001 18:11:37 -0700 (PDT) (envelope-from des@ofug.org) Received: (from des@localhost) by flood.ping.uio.no (8.9.3/8.9.3) id DAA54843; Mon, 9 Jul 2001 03:11:35 +0200 (CEST) (envelope-from des@ofug.org) X-URL: http://www.ofug.org/~des/ X-Disclaimer: The views expressed in this message do not necessarily coincide with those of any organisation or company with which I am or have been affiliated. To: Jens Schweikhardt Cc: freebsd-current@FreeBSD.ORG Subject: Re: sysctl -A prints garbage References: <20010708210717.A21541@schweikhardt.net> From: Dag-Erling Smorgrav Date: 09 Jul 2001 03:11:35 +0200 In-Reply-To: Message-ID: Lines: 33 User-Agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Dag-Erling Smorgrav writes: > Jens Schweikhardt writes: > > -current as of Jun 17, even with an updated sysctl.c revision 1.36, > > prints garbage when used with -A: > Remove the line that says "offset--;" near the end of > sys/vm/vm_zone.c. Ick, what am I saying - this alone isn't enough, you need to increment offset after setting *offset to '\0'. Index: vm_zone.c =================================================================== RCS file: /home/ncvs/src/sys/vm/vm_zone.c,v retrieving revision 1.45 diff -u -u -r1.45 vm_zone.c --- vm_zone.c 2001/07/04 16:20:28 1.45 +++ vm_zone.c 2001/07/09 01:09:51 @@ -451,8 +451,7 @@ offset += len; } mtx_unlock(&zone_mtx); - offset--; - *offset = '\0'; + *offset++ = '\0'; error = SYSCTL_OUT(req, tmpbuf, offset - tmpbuf); out: FREE(tmpbuf, M_TEMP); Untested, caveat emptor, etc. DES -- Dag-Erling Smorgrav - des@ofug.org To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message