summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilliam Hubbs <w.d.hubbs@gmail.com>2012-10-24 12:29:29 -0500
committerWilliam Hubbs <w.d.hubbs@gmail.com>2012-10-28 15:02:41 -0500
commitf53645b7c728492a8d3e6bb7f2fe8bcbce92cf7d (patch)
treeaba3c3f2fdc477cd33c928747906fd45341b78af
parenta75a9940b0786ae8c531a22bd6477799d0b0549a (diff)
downloadopenrc-f53645b7c728492a8d3e6bb7f2fe8bcbce92cf7d.tar.gz
openrc-f53645b7c728492a8d3e6bb7f2fe8bcbce92cf7d.tar.bz2
openrc-f53645b7c728492a8d3e6bb7f2fe8bcbce92cf7d.tar.xz
mountinfo: respect the -q command line option
Previously, we were setting the quiet flag before the command line was parsed. Since the flag is only used once, we can just read the environment variable which is set by the parsing process. Reported-by: <devurandom@gmx.net> X-Gentoo-Bug: 439010 X-Gentoo-Bug-URL: http://bugs.gentoo.org/show_bug.cgi?id=439010
-rw-r--r--src/rc/mountinfo.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/rc/mountinfo.c b/src/rc/mountinfo.c
index eaace13..43d9c83 100644
--- a/src/rc/mountinfo.c
+++ b/src/rc/mountinfo.c
@@ -390,11 +390,8 @@ mountinfo(int argc, char **argv)
char real_path[PATH_MAX + 1];
int opt;
int result;
- bool quiet;
char *this_path;
- quiet = rc_yesno(getenv("EINFO_QUIET"));
-
#define DO_REG(_var) \
if (_var) free(_var); \
_var = get_regex(optarg);
@@ -483,7 +480,7 @@ mountinfo(int argc, char **argv)
if (skip_point_regex &&
regexec(skip_point_regex, s->value, 0, NULL, 0) == 0)
continue;
- if (! quiet)
+ if (! rc_yesno(getenv("EINFO_QUIET")))
printf("%s\n", s->value);
result = EXIT_SUCCESS;
}