Silently fall back to read-only mounting, when we get EROFS.

We do not want to enforce read-only mounting (like mount_iso does)
because we want to write adosfs writing code eventually.
This commit is contained in:
is 2001-02-22 21:34:57 +00:00
parent 659f65e0ee
commit 05378de234
1 changed files with 14 additions and 4 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: mount_ados.c,v 1.12 2000/10/30 20:56:58 jdolecek Exp $ */
/* $NetBSD: mount_ados.c,v 1.13 2001/02/22 21:34:57 is Exp $ */
/*
* Copyright (c) 1994 Christopher G. Demetriou
@ -36,7 +36,7 @@
#include <sys/cdefs.h>
#ifndef lint
__RCSID("$NetBSD: mount_ados.c,v 1.12 2000/10/30 20:56:58 jdolecek Exp $");
__RCSID("$NetBSD: mount_ados.c,v 1.13 2001/02/22 21:34:57 is Exp $");
#endif /* not lint */
#include <sys/cdefs.h>
@ -55,6 +55,7 @@ __RCSID("$NetBSD: mount_ados.c,v 1.12 2000/10/30 20:56:58 jdolecek Exp $");
#include <adosfs/adosfs.h>
#include "mntopts.h"
#include <errno.h>
#include <fattr.h>
static const struct mntopt mopts[] = {
@ -144,10 +145,19 @@ mount_ados(argc, argv)
args.mask = sb.st_mode & (S_IRWXU | S_IRWXG | S_IRWXO);
}
if (mount(MOUNT_ADOSFS, dir, mntflags, &args) < 0)
if (mount(MOUNT_ADOSFS, dir, mntflags, &args) >= 0)
exit (0);
if (errno != EROFS)
err(1, "%s on %s", dev, dir);
exit (0);
mntflags |= MNT_RDONLY;
args.export.ex_flags = MNT_EXRDONLY;
if (mount(MOUNT_ADOSFS, dir, mntflags, &args) >= 0)
exit (0);
err(1, "%s on %s", dev, dir);
}
static void