From owner-freebsd-bugs@FreeBSD.ORG Wed May 9 23:10:04 2007 Return-Path: X-Original-To: freebsd-bugs@hub.freebsd.org Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3C12A16A403 for ; Wed, 9 May 2007 23:10:04 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [69.147.83.40]) by mx1.freebsd.org (Postfix) with ESMTP id 0526413C468 for ; Wed, 9 May 2007 23:10:04 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id l49NA3sR089805 for ; Wed, 9 May 2007 23:10:03 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id l49NA3ut089804; Wed, 9 May 2007 23:10:03 GMT (envelope-from gnats) Resent-Date: Wed, 9 May 2007 23:10:03 GMT Resent-Message-Id: <200705092310.l49NA3ut089804@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Ighighi Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4BABF16A400 for ; Wed, 9 May 2007 23:01:14 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [69.147.83.33]) by mx1.freebsd.org (Postfix) with ESMTP id 36A3313C45E for ; Wed, 9 May 2007 23:01:14 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.13.1/8.13.1) with ESMTP id l49N1D24048981 for ; Wed, 9 May 2007 23:01:13 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.13.1/8.13.1/Submit) id l49MuCps029435; Wed, 9 May 2007 22:56:12 GMT (envelope-from nobody) Message-Id: <200705092256.l49MuCps029435@www.freebsd.org> Date: Wed, 9 May 2007 22:56:12 GMT From: Ighighi To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.0 Cc: Subject: bin/112556: [patch]: [bin]: sysctl(8) needs to fix multi-lineal descriptions X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 May 2007 23:10:04 -0000 >Number: 112556 >Category: bin >Synopsis: [patch]: [bin]: sysctl(8) needs to fix multi-lineal descriptions >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Wed May 09 23:10:03 GMT 2007 >Closed-Date: >Last-Modified: >Originator: Ighighi >Release: 6.2-STABLE >Organization: >Environment: FreeBSD orion 6.2-STABLE FreeBSD 6.2-STABLE #1: Sat May 5 10:13:59 VET 2007 root@orion:/usr/obj/usr/src/sys/CUSTOM i386 >Description: This patch to sysctl(8) makes it handle multi-lineal descriptions (currently found in hw.pci.enable_io_modes, hw.pci.do_power_nodriver, hw.pci.host_mem_start & hw.pci.irq_override_mask) so they appear on just one line. A patch to the PCI files available upon request but other modules that I didn't load could have multi-line descriptions as well, so patching sysctl(8) is necessary. >How-To-Repeat: /sbin/sysctl -d hw.pci.enable_io_modes hw.pci.do_power_nodriver hw.pci.host_mem_start hw.pci.irq_override_mask >Fix: Attached patch available. Patch attached with submission follows: --- sbin/sysctl/sysctl.c.orig Wed Mar 21 21:27:09 2007 +++ sbin/sysctl/sysctl.c Sat May 5 09:21:16 2007 @@ -568,11 +568,16 @@ sep = ": "; if (dflag) { /* just print description */ + char *s = buf; + qoid[1] = 5; j = sizeof(buf); i = sysctl(qoid, nlen + 2, buf, &j, 0, 0); if (!nflag) printf("%s%s", name, sep); + /* fix multilineal descriptions */ + while ((s = strchr(s, '\n')) != NULL) + *s++ = ' '; printf("%s", buf); return (0); } >Release-Note: >Audit-Trail: >Unformatted: