Author: jh Date: Fri Jan 20 10:06:28 2012 New Revision: 230373 URL: http://svn.freebsd.org/changeset/base/230373
Log: 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 Modified: head/sbin/mount/mount_fs.c Modified: head/sbin/mount/mount_fs.c ============================================================================== --- head/sbin/mount/mount_fs.c Fri Jan 20 07:29:29 2012 (r230372) +++ head/sbin/mount/mount_fs.c Fri Jan 20 10:06:28 2012 (r230373) @@ -82,7 +82,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)); @@ -128,10 +127,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); } _______________________________________________ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"