diff options
author | jh <jh@FreeBSD.org> | 2009-10-07 13:25:22 +0000 |
---|---|---|
committer | jh <jh@FreeBSD.org> | 2009-10-07 13:25:22 +0000 |
commit | e6e0b17268af63f977c1bb28440d036cf9a32419 (patch) | |
tree | 930e7694348209c10a16e7f03f92f04dd2c74efc /usr.sbin | |
parent | 93044b9323bbd25e68f3bd2865b64147d9dc7c6c (diff) | |
download | FreeBSD-src-e6e0b17268af63f977c1bb28440d036cf9a32419.zip FreeBSD-src-e6e0b17268af63f977c1bb28440d036cf9a32419.tar.gz |
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
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/cdcontrol/cdcontrol.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/usr.sbin/cdcontrol/cdcontrol.c b/usr.sbin/cdcontrol/cdcontrol.c index ede5904..a4b13d8 100644 --- a/usr.sbin/cdcontrol/cdcontrol.c +++ b/usr.sbin/cdcontrol/cdcontrol.c @@ -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) |