aboutsummaryrefslogtreecommitdiff
path: root/sbin/mount/getmntopts.c
diff options
context:
space:
mode:
Diffstat (limited to 'sbin/mount/getmntopts.c')
-rw-r--r--sbin/mount/getmntopts.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/sbin/mount/getmntopts.c b/sbin/mount/getmntopts.c
index 1af5e0f0d460..75c75b202416 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);