svn commit: r236901 - stable/8/sbin/mount
Jaakko Heinonen
jh at FreeBSD.org
Mon Jun 11 18:02:30 UTC 2012
Author: jh
Date: Mon Jun 11 18:02:30 2012
New Revision: 236901
URL: http://svn.freebsd.org/changeset/base/236901
Log:
MFC r230373:
Change mount_fs() to not exit on error. The "failok" mount option
requires that errors are passed to the caller.
PR: 163668
Modified:
stable/8/sbin/mount/mount_fs.c
Directory Properties:
stable/8/sbin/mount/ (props changed)
Modified: stable/8/sbin/mount/mount_fs.c
==============================================================================
--- stable/8/sbin/mount/mount_fs.c Mon Jun 11 17:54:40 2012 (r236900)
+++ stable/8/sbin/mount/mount_fs.c Mon Jun 11 18:02:30 2012 (r236901)
@@ -86,7 +86,6 @@ mount_fs(const char *vfstype, int argc,
char fstype[32];
char errmsg[255];
char *p, *val;
- int ret;
strlcpy(fstype, vfstype, sizeof(fstype));
memset(errmsg, 0, sizeof(errmsg));
@@ -129,10 +128,10 @@ mount_fs(const char *vfstype, int argc,
build_iovec(&iov, &iovlen, "fspath", mntpath, (size_t)-1);
build_iovec(&iov, &iovlen, "from", dev, (size_t)-1);
build_iovec(&iov, &iovlen, "errmsg", errmsg, sizeof(errmsg));
-
- ret = nmount(iov, iovlen, mntflags);
- if (ret < 0)
- err(1, "%s %s", dev, errmsg);
- return (ret);
+ if (nmount(iov, iovlen, mntflags) == -1) {
+ warn("%s: %s", dev, errmsg);
+ return (1);
+ }
+ return (0);
}
More information about the svn-src-stable-8
mailing list