summaryrefslogtreecommitdiff
path: root/sbin
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2007-11-17 17:18:33 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2007-11-17 17:18:33 +0000
commitd01a489fa1219c61fda09f57afb85c8191c6806e (patch)
tree967e5d7ee61cfc16455003154e1ad08f8c4c9444 /sbin
parentf1b5948b1c9b64b4c9267ddf914d22306af735f1 (diff)
Don't err() out if a fstab line refers to a non-existant mount point.
Just print an error message and allow processing to continue. This fixes 'mount -a' so it mounts all the filesystems it can rather than skipping all fstab entries after a non-existant mount point. This also brings us more into line with NetBSD and FreeBSD behaviour. ok deraadt@ jsing@ millert@
Diffstat (limited to 'sbin')
-rw-r--r--sbin/mount/mount.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/sbin/mount/mount.c b/sbin/mount/mount.c
index 8100cecb635..6f2ab5e6507 100644
--- a/sbin/mount/mount.c
+++ b/sbin/mount/mount.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mount.c,v 1.47 2007/10/16 20:19:27 sobrado Exp $ */
+/* $OpenBSD: mount.c,v 1.48 2007/11/17 17:18:32 krw Exp $ */
/* $NetBSD: mount.c,v 1.24 1995/11/18 03:34:29 cgd Exp $ */
/*
@@ -40,7 +40,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)mount.c 8.19 (Berkeley) 4/19/94";
#else
-static char rcsid[] = "$OpenBSD: mount.c,v 1.47 2007/10/16 20:19:27 sobrado Exp $";
+static char rcsid[] = "$OpenBSD: mount.c,v 1.48 2007/11/17 17:18:32 krw Exp $";
#endif
#endif /* not lint */
@@ -375,8 +375,10 @@ mountfs(const char *vfstype, const char *spec, const char *name,
if (!hasopt(optbuf, "update"))
optbuf = catopt(optbuf, "update");
} else if (skipmounted) {
- if (statfs(name, &sf) < 0)
- err(1, "statfs %s", name);
+ if (statfs(name, &sf) < 0) {
+ warn("statfs %s", name);
+ return (1);
+ }
/* XXX can't check f_mntfromname, thanks to mfs, etc. */
if (strncmp(name, sf.f_mntonname, MNAMELEN) == 0 &&
strncmp(vfstype, sf.f_fstypename, MFSNAMELEN) == 0) {