diff options
author | Kenneth R Westerback <krw@cvs.openbsd.org> | 2007-11-17 17:18:33 +0000 |
---|---|---|
committer | Kenneth R Westerback <krw@cvs.openbsd.org> | 2007-11-17 17:18:33 +0000 |
commit | d01a489fa1219c61fda09f57afb85c8191c6806e (patch) | |
tree | 967e5d7ee61cfc16455003154e1ad08f8c4c9444 | |
parent | f1b5948b1c9b64b4c9267ddf914d22306af735f1 (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@
-rw-r--r-- | sbin/mount/mount.c | 10 |
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) { |