aboutsummaryrefslogtreecommitdiff
path: root/src/fstabinfo.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2007-09-25 22:45:57 +0000
committerRoy Marples <roy@marples.name>2007-09-25 22:45:57 +0000
commitcc3c5ad11108c357a526845d4231a1e22aa5e8c2 (patch)
tree80a00bb136a72cc56e41f1bab03c71d040dbe426 /src/fstabinfo.c
parentda471b7deba436339bf8b3d9436212b9ef384257 (diff)
fstabinto now behaves more like mountinfo with respect to --quiet
Diffstat (limited to 'src/fstabinfo.c')
-rw-r--r--src/fstabinfo.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/src/fstabinfo.c b/src/fstabinfo.c
index b35c6edd..d41e0339 100644
--- a/src/fstabinfo.c
+++ b/src/fstabinfo.c
@@ -96,7 +96,7 @@ int fstabinfo (int argc, char **argv)
#else
struct fstab *ent;
#endif
- int result = EXIT_FAILURE;
+ int result = EXIT_SUCCESS;
char *token;
int i;
int opt;
@@ -162,13 +162,7 @@ int fstabinfo (int argc, char **argv)
while (optind < argc)
rc_strlist_add (&files, argv[optind++]);
- if (! files) {
- if (filtered) {
- if (! rc_is_env ("RC_QUIET", "yes"))
- eerror ("%s: no matches found", argv[0]);
- exit (EXIT_FAILURE);
- }
-
+ if (! files && ! filtered) {
START_ENT;
while ((ent = GET_ENT))
rc_strlist_add (&files, ENT_FILE (ent));
@@ -182,12 +176,14 @@ int fstabinfo (int argc, char **argv)
START_ENT;
STRLIST_FOREACH (files, file, i) {
if (! (ent = GET_ENT_FILE (file))) {
- if (! rc_is_env ("RC_QUIET", "yes"))
- eerror ("%s: no such entry `%s'", argv[0], file);
result = EXIT_FAILURE;
continue;
}
+ /* No point in outputting if quiet */
+ if (rc_is_env ("RC_QUIET", "yes"))
+ continue;
+
switch (output) {
case OUTPUT_MOUNTCMD:
printf ("-o %s -t %s %s %s\n", ENT_OPTS (ent), ENT_TYPE (ent),