summaryrefslogtreecommitdiffstats
path: root/usr.sbin/pw/pw.c
diff options
context:
space:
mode:
authorbapt <bapt@FreeBSD.org>2015-07-11 17:01:08 +0000
committerbapt <bapt@FreeBSD.org>2015-07-11 17:01:08 +0000
commit45674912578ba1480166b5c9537c35fb30123083 (patch)
tree4d647d53d630bc678cccc24bbbb9f7df51a934a8 /usr.sbin/pw/pw.c
parent032c1600ece5fbb82f126701974fc66146ebbf24 (diff)
downloadFreeBSD-src-45674912578ba1480166b5c9537c35fb30123083.zip
FreeBSD-src-45674912578ba1480166b5c9537c35fb30123083.tar.gz
Move the quiet flag into the configuration structure
Diffstat (limited to 'usr.sbin/pw/pw.c')
-rw-r--r--usr.sbin/pw/pw.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/usr.sbin/pw/pw.c b/usr.sbin/pw/pw.c
index 6769738..951abc6 100644
--- a/usr.sbin/pw/pw.c
+++ b/usr.sbin/pw/pw.c
@@ -314,6 +314,9 @@ main(int argc, char *argv[])
case 'o':
conf.checkduplicate = true;
break;
+ case 'q':
+ conf.quiet = true;
+ break;
default:
addarg(&arglist, ch, optarg);
break;
@@ -334,7 +337,7 @@ main(int argc, char *argv[])
* We should immediately look for the -q 'quiet' switch so that we
* don't bother with extraneous errors
*/
- if (getarg(&arglist, 'q') != NULL)
+ if (conf.quiet)
freopen(_PATH_DEVNULL, "w", stderr);
/*
OpenPOWER on IntegriCloud