From owner-svn-src-head@FreeBSD.ORG Wed Oct 7 13:25:23 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4ECDF106568F; Wed, 7 Oct 2009 13:25:23 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3DFD88FC1E; Wed, 7 Oct 2009 13:25:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n97DPNrI085486; Wed, 7 Oct 2009 13:25:23 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n97DPNJN085484; Wed, 7 Oct 2009 13:25:23 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <200910071325.n97DPNJN085484@svn.freebsd.org> From: Jaakko Heinonen Date: Wed, 7 Oct 2009 13:25:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197833 - head/usr.sbin/cdcontrol X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Oct 2009 13:25:23 -0000 Author: jh Date: Wed Oct 7 13:25:22 2009 New Revision: 197833 URL: http://svn.freebsd.org/changeset/base/197833 Log: When run() returns an error, print the error message also in non-interactive mode. Previously error messages were printed only in interactive mode. PR: bin/124517 Approved by: trasz (mentor) MFC after: 1 month Modified: head/usr.sbin/cdcontrol/cdcontrol.c Modified: head/usr.sbin/cdcontrol/cdcontrol.c ============================================================================== --- head/usr.sbin/cdcontrol/cdcontrol.c Wed Oct 7 13:12:43 2009 (r197832) +++ head/usr.sbin/cdcontrol/cdcontrol.c Wed Oct 7 13:25:22 2009 (r197833) @@ -241,7 +241,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); @@ -257,7 +257,11 @@ int main (int argc, char **argv) } *p = 0; arg = parse (buf, &cmd); - return (run (cmd, arg)); + rc = run (cmd, arg); + if (rc < 0 && verbose) + warn(NULL); + + return (rc); } if (verbose == 1)