diff options
author | jh <jh@FreeBSD.org> | 2012-01-20 10:06:28 +0000 |
---|---|---|
committer | jh <jh@FreeBSD.org> | 2012-01-20 10:06:28 +0000 |
commit | 228073c1125c3e506f2a84eae0788f95927c76e4 (patch) | |
tree | a263a08410a6bcaa99d02817f9ca033dc781f315 /sbin/mount | |
parent | e6f0693c66f91a339f459a393b7d37504309e7fb (diff) | |
download | FreeBSD-src-228073c1125c3e506f2a84eae0788f95927c76e4.zip FreeBSD-src-228073c1125c3e506f2a84eae0788f95927c76e4.tar.gz |
Change mount_fs() to not exit on error. The "failok" mount option
requires that errors are passed to the caller.
PR: 163668
Reviewed by: Garrett Cooper
Diffstat (limited to 'sbin/mount')
-rw-r--r-- | sbin/mount/mount_fs.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/sbin/mount/mount_fs.c b/sbin/mount/mount_fs.c index 4c58857..fd7b529 100644 --- a/sbin/mount/mount_fs.c +++ b/sbin/mount/mount_fs.c @@ -82,7 +82,6 @@ mount_fs(const char *vfstype, int argc, char *argv[]) char fstype[32]; char errmsg[255]; char *p, *val; - int ret; strlcpy(fstype, vfstype, sizeof(fstype)); memset(errmsg, 0, sizeof(errmsg)); @@ -128,10 +127,10 @@ mount_fs(const char *vfstype, int argc, char *argv[]) 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); } |