summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2007-09-25 12:22:48 +0000
committerRoy Marples <roy@marples.name>2007-09-25 12:22:48 +0000
commita2e5c4513e2955bc0a77c401ea12cc210eab305b (patch)
tree617190749b14f31fd464a779ab915c7938383c5c
parent9d9880feac8cddee37d3cb1066cc4387f6aafdef (diff)
downloadopenrc-a2e5c4513e2955bc0a77c401ea12cc210eab305b.tar.gz
openrc-a2e5c4513e2955bc0a77c401ea12cc210eab305b.tar.bz2
openrc-a2e5c4513e2955bc0a77c401ea12cc210eab305b.tar.xz
Use -t for -fstype to match mount to make vapier happy
-rw-r--r--src/fstabinfo.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/fstabinfo.c b/src/fstabinfo.c
index a5dd887..e06a490 100644
--- a/src/fstabinfo.c
+++ b/src/fstabinfo.c
@@ -58,12 +58,12 @@ static struct mntent *getmntfile (FILE *fp, const char *file)
#endif
#include "_usage.h"
-#define getoptstring "f:m:o:p:" getoptstring_COMMON
+#define getoptstring "m:o:p:t:" getoptstring_COMMON
static struct option longopts[] = {
- { "fstype", 1, NULL, 'f'},
{ "mountcmd", 1, NULL, 'm'},
{ "options", 1, NULL, 'o'},
{ "passno", 1, NULL, 'p'},
+ { "fstype", 1, NULL, 't'},
longopts_COMMON
{ NULL, 0, NULL, 0}
};
@@ -89,14 +89,6 @@ int fstabinfo (int argc, char **argv)
fp = setmntent ("/etc/fstab", "r");
#endif
switch (opt) {
- case 'f':
- while ((token = strsep (&optarg, ",")))
- while ((ent = GET_ENT))
- if (strcmp (token, ENT_TYPE (ent)) == 0)
- printf ("%s\n", ENT_FILE (ent));
- result = EXIT_SUCCESS;
- break;
-
case 'm':
if ((ent = GET_ENT_FILE (optarg))) {
printf ("-o %s -t %s %s %s\n", ENT_OPTS (ent), ENT_TYPE (ent),
@@ -141,6 +133,14 @@ int fstabinfo (int argc, char **argv)
}
break;
+ case 't':
+ while ((token = strsep (&optarg, ",")))
+ while ((ent = GET_ENT))
+ if (strcmp (token, ENT_TYPE (ent)) == 0)
+ printf ("%s\n", ENT_FILE (ent));
+ result = EXIT_SUCCESS;
+ break;
+
case_RC_COMMON_GETOPT
}
@@ -151,7 +151,7 @@ int fstabinfo (int argc, char **argv)
}
if (result != EXIT_SUCCESS && argc == optind)
- fprintf (stderr, "%s: no arguments specified\n", argv[0]);
+ eerrorx ("%s: no arguments specified", argv[0]);
exit (result);
}