From owner-freebsd-bugs@FreeBSD.ORG Thu Jun 12 16:20:03 2008 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4A45B106567C for ; Thu, 12 Jun 2008 16:20:03 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 27D028FC19 for ; Thu, 12 Jun 2008 16:20:03 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.2/8.14.2) with ESMTP id m5CGK2dr070726 for ; Thu, 12 Jun 2008 16:20:02 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.2/8.14.1/Submit) id m5CGK2o2070725; Thu, 12 Jun 2008 16:20:02 GMT (envelope-from gnats) Resent-Date: Thu, 12 Jun 2008 16:20:02 GMT Resent-Message-Id: <200806121620.m5CGK2o2070725@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, Jaakko Heinonen Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A527B1065674 for ; Thu, 12 Jun 2008 16:13:07 +0000 (UTC) (envelope-from jaakko@saunalahti.fi) Received: from gw02.mail.saunalahti.fi (gw02.mail.saunalahti.fi [195.197.172.116]) by mx1.freebsd.org (Postfix) with ESMTP id 681888FC1B for ; Thu, 12 Jun 2008 16:13:07 +0000 (UTC) (envelope-from jaakko@saunalahti.fi) Received: from ws64.jh.dy.fi (a91-153-120-204.elisa-laajakaista.fi [91.153.120.204]) by gw02.mail.saunalahti.fi (Postfix) with ESMTP id D81D4139B69 for ; Thu, 12 Jun 2008 18:54:32 +0300 (EEST) Received: from ws64.jh.dy.fi (localhost [127.0.0.1]) by ws64.jh.dy.fi (8.14.2/8.14.2) with ESMTP id m5CFsWd6004536 for ; Thu, 12 Jun 2008 18:54:32 +0300 (EEST) (envelope-from jaakko@ws64.jh.dy.fi) Received: (from jaakko@localhost) by ws64.jh.dy.fi (8.14.2/8.14.2/Submit) id m5CFsWw8004535; Thu, 12 Jun 2008 18:54:32 +0300 (EEST) (envelope-from jaakko) Message-Id: <200806121554.m5CFsWw8004535@ws64.jh.dy.fi> Date: Thu, 12 Jun 2008 18:54:32 +0300 (EEST) From: Jaakko Heinonen To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: Subject: bin/124517: [patch] cdcontrol(1) doesn't print all error messages in non-interactive mode 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: Thu, 12 Jun 2008 16:20:03 -0000 >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: