summaryrefslogtreecommitdiffstats
path: root/sbin/mount/mount_fs.c
diff options
context:
space:
mode:
Diffstat (limited to 'sbin/mount/mount_fs.c')
-rw-r--r--sbin/mount/mount_fs.c11
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);
}
OpenPOWER on IntegriCloud