path: root/sbin/mount_ifs/getmntopts.c
diff options
authorGarrett Wollman <wollman@FreeBSD.org>1994-11-01 23:51:53 +0000
committerGarrett Wollman <wollman@FreeBSD.org>1994-11-01 23:51:53 +0000
commit3fa88dec7f907cbcfee54e5ebebc001a3279fe30 (patch)
treef614541c69f463075bbc04969273cb64b172d603 /sbin/mount_ifs/getmntopts.c
parentf23c6e08dfc2a3411b55e1b7a6a916bde7c5862d (diff)
Add support for filesystem-specific `-o' options, and re-implement the
most common cd9660 and nfs options like God intended them. (It is now possible to say mount -o ro,soft,bg,intr there:/foo/bar /foo/bar again.) This whole getmntopt() business is an incredible botch; it never should have been anything more than a wrapper around getsubopt(3). Because if the way the current hackaround is implemented, options which take arguments (like the old `rsize' and `wsize') are still unavailable, and must be accessed the new, broken way. (It's unimaginable how Berkeley managed to screw up one of the few things about NFS that Sun actually got right to begin with!)
Notes: svn path=/head/; revision=4065
Diffstat (limited to 'sbin/mount_ifs/getmntopts.c')
1 files changed, 10 insertions, 4 deletions
diff --git a/sbin/mount_ifs/getmntopts.c b/sbin/mount_ifs/getmntopts.c
index 1af5e0f0d460..75c75b202416 100644
--- a/sbin/mount_ifs/getmntopts.c
+++ b/sbin/mount_ifs/getmntopts.c
@@ -46,15 +46,19 @@ static char sccsid[] = "@(#)getmntopts.c 8.1 (Berkeley) 3/27/94";
#include "mntopts.h"
+int getmnt_silent = 0;
-getmntopts(options, m0, flagp)
+getmntopts(options, m0, flagp, altflagp)
const char *options;
const struct mntopt *m0;
int *flagp;
+ int *altflagp;
const struct mntopt *m;
int negative, len;
char *opt, *optbuf;
+ int *thisflagp;
/* Copy option string, since it is about to be torn asunder... */
if ((optbuf = strdup(options)) == NULL)
@@ -80,12 +84,14 @@ getmntopts(options, m0, flagp)
/* Save flag, or fail if option is not recognised. */
if (m->m_option) {
+ thisflagp = m->m_altloc ? altflagp : flagp;
if (negative == m->m_inverse)
- *flagp |= m->m_flag;
+ *thisflagp |= m->m_flag;
- *flagp &= ~m->m_flag;
- } else
+ *thisflagp &= ~m->m_flag;
+ } else if(!getmnt_silent) {
errx(1, "-o %s: option not supported", opt);
+ }