Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 12 Jun 2008 18:54:32 +0300 (EEST)
From:      Jaakko Heinonen <jh@saunalahti.fi>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   bin/124517: [patch] cdcontrol(1) doesn't print all error messages in non-interactive mode
Message-ID:  <200806121554.m5CFsWw8004535@ws64.jh.dy.fi>
Resent-Message-ID: <200806121620.m5CGK2o2070725@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         124517
>Category:       bin
>Synopsis:       [patch] cdcontrol(1) doesn't print all error messages in non-interactive mode
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Jun 12 16:20:02 UTC 2008
>Closed-Date:
>Last-Modified:
>Originator:     Jaakko Heinonen
>Release:        FreeBSD 7.0-STABLE amd64
>Organization:
>Environment:
System: FreeBSD x 7.0-STABLE FreeBSD 7.0-STABLE #0: Wed Jun 11 19:18:10 EEST 2008 x:X amd64


	
>Description:
Some error messages are printed only in interactive mode.
>How-To-Repeat:
(No CD in drive)

$ cdcontrol 
Compact Disc Control utility, version 2.0
Type `?' for command list

cdcontrol> play 1
cdcontrol: Input/output error
cdcontrol> ^D
$ cdcontrol play 1
$

After applying the patch attached to this PR:

$ cdcontrol play 1
cdcontrol: Input/output error
$
>Fix:

--- cdcontrol-error-reporting.diff begins here ---
Index: usr.sbin/cdcontrol/cdcontrol.c
===================================================================
--- usr.sbin/cdcontrol/cdcontrol.c	(revision 179721)
+++ usr.sbin/cdcontrol/cdcontrol.c	(working copy)
@@ -228,7 +228,7 @@ int main (int argc, char **argv)
 
 	if (argc > 0) {
 		char buf[80], *p;
-		int len;
+		int len, rc;
 
 		for (p=buf; argc-->0; ++argv) {
 			len = strlen (*argv);
@@ -244,7 +244,10 @@ int main (int argc, char **argv)
 		}
 		*p = 0;
 		arg = parse (buf, &cmd);
-		return (run (cmd, arg));
+		if ((rc = run (cmd, arg)) < 0 && verbose)
+			warn(NULL);
+
+		return (rc);
 	}
 
 	if (verbose == 1)
--- cdcontrol-error-reporting.diff ends here ---


>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200806121554.m5CFsWw8004535>