From steinarh@mail.broadpark.no  Sat Dec 18 02:34:26 2004
Return-Path: <steinarh@mail.broadpark.no>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 8ECB616A4CE
	for <FreeBSD-gnats-submit@freebsd.org>; 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 <FreeBSD-gnats-submit@freebsd.org>; 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
 <FreeBSD-gnats-submit@freebsd.org>; 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 <steinarh@pvv.ntnu.no>
Reply-To: Steinar Hamre <steinarh@pvv.ntnu.no>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: Vinum writes several errors to stdout.
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         75211
>Category:       kern
>Synopsis:       [vinum] vinum writes several errors to stdout.
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    le
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Dec 18 02:40:35 GMT 2004
>Closed-Date:    Sat Nov 26 15:31:17 GMT 2005
>Last-Modified:  Sat Nov 26 15:31:17 GMT 2005
>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:
Responsible-Changed-From-To: freebsd-bugs->le 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Sun Apr 3 08:59:10 GMT 2005 
Responsible-Changed-Why:  
Over to maintainer. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=75211 
State-Changed-From-To: open->closed 
State-Changed-By: le 
State-Changed-When: Sat Nov 26 15:30:43 GMT 2005 
State-Changed-Why:  
'Classic' vinum isn't supported anymore, so it isn't very likely 
that this patch will be committed. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=75211 
>Unformatted:
