From owner-freebsd-bugs@FreeBSD.ORG Sat Dec 18 02:40:39 2004 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7078216A500 for ; Sat, 18 Dec 2004 02:40:39 +0000 (GMT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 48A2843D64 for ; Sat, 18 Dec 2004 02:40:36 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.1/8.13.1) with ESMTP id iBI2eaOf029367 for ; Sat, 18 Dec 2004 02:40:36 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.1/8.13.1/Submit) id iBI2eaZf029363; Sat, 18 Dec 2004 02:40:36 GMT (envelope-from gnats) Resent-Date: Sat, 18 Dec 2004 02:40:36 GMT Resent-Message-Id: <200412180240.iBI2eaZf029363@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, Steinar Hamre Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8ECB616A4CE for ; Sat, 18 Dec 2004 02:34:26 +0000 (GMT) Received: from bgo1smout1.broadpark.no (bgo1smout1.broadpark.no [217.13.4.94]) by mx1.FreeBSD.org (Postfix) with ESMTP id B0B4C43D1F for ; Sat, 18 Dec 2004 02:34:25 +0000 (GMT) (envelope-from steinarh@mail.broadpark.no) Received: from bgo1sminn1.broadpark.no ([217.13.4.93]) by bgo1smout1.broadpark.no (Sun Java System Messaging Server 6.1 HotFix 0.05 (built Oct 21 2004)) with ESMTP id <0I8W00276C9GE640@bgo1smout1.broadpark.no> for FreeBSD-gnats-submit@freebsd.org; Sat, 18 Dec 2004 03:29:40 +0100 (CET) Received: from sulle.pvv.ntnu.no ([80.203.121.212]) by bgo1sminn1.broadpark.no (Sun Java System Messaging Server 6.1 HotFix 0.05 (built Oct 21 2004)) with ESMTP id <0I8W003WGCMTCTD0@bgo1sminn1.broadpark.no> for FreeBSD-gnats-submit@freebsd.org; Sat, 18 Dec 2004 03:37:49 +0100 (CET) Received: from sulle.pvv.ntnu.no (localhost [127.0.0.1]) by sulle.pvv.ntnu.no (8.13.1/8.13.1) with ESMTP id iBI2Q69q019342 for ; Sat, 18 Dec 2004 03:26:10 +0100 Received: (from steinarh@localhost) by sulle.pvv.ntnu.no (8.13.1/8.13.1/Submit) id iBI2Q4qx019341; Sat, 18 Dec 2004 03:26:04 +0100 (CET envelope-from steinarh) Message-Id: <200412180226.iBI2Q4qx019341@sulle.pvv.ntnu.no> Date: Sat, 18 Dec 2004 03:26:04 +0100 (CET) From: Steinar Hamre To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Subject: kern/75211: Vinum writes several errors to stdout. X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Steinar Hamre List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Dec 2004 02:40:39 -0000 >Number: 75211 >Category: kern >Synopsis: Vinum writes several errors to stdout. >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: Sat Dec 18 02:40:35 GMT 2004 >Closed-Date: >Last-Modified: >Originator: Steinar Hamre >Release: FreeBSD 5.3-STABLE i386 >Organization: Programvareverkstedet >Environment: System: FreeBSD sulle.pvv.ntnu.no 5.3-STABLE FreeBSD 5.3-STABLE #47: Fri Oct 29 01:05:47 CEST 2004 root@sulle.pvv.ntnu.no:/usr/obj/usr/src/sys/SULLE i386 >Description: In some error situations vinum logs errors to stdout. This is incovenient as vinum is often used from shell scrips and in such scrips stdout is almost always routed saved to a file or routed to /dev/null. (The output from each new vinum create can easily be more than 1000 lines on a system with a few hundred partitions.) >How-To-Repeat: >Fix: Index: v.c =================================================================== RCS file: /home/ncvs/src/sbin/vinum/Attic/v.c,v retrieving revision 1.40 diff -u -r1.40 v.c --- v.c 16 Feb 2004 09:23:59 -0000 1.40 +++ v.c 18 Dec 2004 02:31:35 -0000 @@ -658,7 +658,7 @@ } exit(0); /* when told to die */ } else if (pid < 0) /* couldn't fork */ - printf("Can't fork to check daemon\n"); + fprintf(stderr, "Can't fork to check daemon\n"); } void Index: commands.c =================================================================== RCS file: /home/ncvs/src/sbin/vinum/Attic/commands.c,v retrieving revision 1.60 diff -u -r1.60 commands.c --- commands.c 24 Jul 2004 19:11:40 -0000 1.60 +++ commands.c 18 Dec 2004 02:03:26 -0000 @@ -93,7 +93,7 @@ return; } if (ioctl(superdev, VINUM_STARTCONFIG, &force)) { /* can't get config? */ - printf("Can't configure: %s (%d)\n", strerror(errno), errno); + fprintf(stderr, "Can't configure: %s (%d)\n", strerror(errno), errno); return; } file_line = 0; /* start with line 1 */ @@ -277,7 +277,7 @@ for (objindex = 0; objindex < argc; objindex++) { objno = find_object(argv[objindex], &type); /* find the object */ if (objno < 0) - printf("Can't find %s\n", argv[objindex]); + fprintf(stderr, "Can't find %s\n", argv[objindex]); else { switch (type) { case volume_object: @@ -293,7 +293,7 @@ break; default: - printf("Can't initialize %s: wrong object type\n", argv[objindex]); + fprintf(stderr, "Can't initialize %s: wrong object type\n", argv[objindex]); break; } } @@ -334,7 +334,7 @@ pid = fork(); /* into the background with you */ if (pid != 0) { /* I'm the parent, or we failed */ if (pid < 0) /* failure */ - printf("Couldn't fork: %s", strerror(errno)); + fprintf(stderr, "Couldn't fork: %s", strerror(errno)); close(plexfh); /* we don't need this any more */ return; } @@ -356,7 +356,7 @@ && (errno == ECHILD)) /* all gone */ break; if (WEXITSTATUS(status) != 0) { /* oh, oh */ - printf("child %d exited with status 0x%x\n", pid, WEXITSTATUS(status)); + fprintf(stderr, "child %d exited with status 0x%x\n", pid, WEXITSTATUS(status)); failed++; } } @@ -389,7 +389,7 @@ if (pid > 0) /* I'm the parent */ return; else if (pid < 0) { /* failure */ - printf("couldn't fork for subdisk %d: %s", sdno, strerror(errno)); + fprintf(stderr, "couldn't fork for subdisk %d: %s", sdno, strerror(errno)); return; } } @@ -1318,7 +1318,7 @@ int ioctltype; if (argc != 0) { - printf("usage: saveconfig\n"); + fprintf(stderr, "usage: saveconfig\n"); return; } ioctltype = 1; /* user saveconfig */ @@ -1420,7 +1420,7 @@ reply = (struct _ioctl_reply *) &buffer; if (ioctl(superdev, VINUM_STARTCONFIG, &force)) { /* can't get config? */ - printf("Can't configure: %s (%d)\n", strerror(errno), errno); + fprintf(stderr, "Can't configure: %s (%d)\n", strerror(errno), errno); return; } if (!objectname) /* we need a name for our object */ @@ -1535,7 +1535,7 @@ return; } if (ioctl(superdev, VINUM_STARTCONFIG, &force)) { /* can't get config? */ - printf("Can't configure: %s (%d)\n", strerror(errno), errno); + fprintf(stderr, "Can't configure: %s (%d)\n", strerror(errno), errno); return; } if (!objectname) /* we need a name for our object */ @@ -1678,7 +1678,7 @@ return; } if (ioctl(superdev, VINUM_STARTCONFIG, &force)) { /* can't get config? */ - printf("Can't configure: %s (%d)\n", strerror(errno), errno); + fprintf(stderr, "Can't configure: %s (%d)\n", strerror(errno), errno); return; } if (!objectname) /* we need a name for our object */ @@ -1821,7 +1821,7 @@ return; } if (ioctl(superdev, VINUM_STARTCONFIG, &force)) { /* can't get config? */ - printf("Can't configure: %s (%d)\n", strerror(errno), errno); + fprintf(stderr, "Can't configure: %s (%d)\n", strerror(errno), errno); return; } if (!objectname) /* we need a name for our object */ @@ -1979,7 +1979,7 @@ return; } if (ioctl(superdev, VINUM_STARTCONFIG, &force)) { /* can't get config? */ - printf("Can't configure: %s (%d)\n", strerror(errno), errno); + fprintf(stderr, "Can't configure: %s (%d)\n", strerror(errno), errno); return; } if (!objectname) /* we need a name for our object */ >Release-Note: >Audit-Trail: >Unformatted: