bin/124517: [patch] cdcontrol(1) doesn't print all error messages
in non-interactive mode
Jaakko Heinonen
jh at saunalahti.fi
Thu Jun 12 16:20:03 UTC 2008
>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:
More information about the freebsd-bugs
mailing list