diff options
author | wollman <wollman@FreeBSD.org> | 1994-11-01 23:51:53 +0000 |
---|---|---|
committer | wollman <wollman@FreeBSD.org> | 1994-11-01 23:51:53 +0000 |
commit | f22ba017a05b76c7d6527ba987fe81cdef085ced (patch) | |
tree | f614541c69f463075bbc04969273cb64b172d603 /sbin/mount/getmntopts.c | |
parent | 4d89ead91e74e5a8e60f0f16733d9d8c15d82542 (diff) | |
download | FreeBSD-src-f22ba017a05b76c7d6527ba987fe81cdef085ced.zip FreeBSD-src-f22ba017a05b76c7d6527ba987fe81cdef085ced.tar.gz |
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!)
Diffstat (limited to 'sbin/mount/getmntopts.c')
-rw-r--r-- | sbin/mount/getmntopts.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/sbin/mount/getmntopts.c b/sbin/mount/getmntopts.c index 1af5e0f..75c75b2 100644 --- a/sbin/mount/getmntopts.c +++ b/sbin/mount/getmntopts.c @@ -46,15 +46,19 @@ static char sccsid[] = "@(#)getmntopts.c 8.1 (Berkeley) 3/27/94"; #include "mntopts.h" +int getmnt_silent = 0; + void -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; else - *flagp &= ~m->m_flag; - } else + *thisflagp &= ~m->m_flag; + } else if(!getmnt_silent) { errx(1, "-o %s: option not supported", opt); + } } free(optbuf); |