From owner-svn-src-all@FreeBSD.ORG Mon Feb 13 18:26:59 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 807511065674; Mon, 13 Feb 2012 18:26:59 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6F38C8FC1C; Mon, 13 Feb 2012 18:26:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1DIQxWE055500; Mon, 13 Feb 2012 18:26:59 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1DIQxhm055498; Mon, 13 Feb 2012 18:26:59 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201202131826.q1DIQxhm055498@svn.freebsd.org> From: Jaakko Heinonen Date: Mon, 13 Feb 2012 18:26:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231591 - stable/9/sbin/mount X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Feb 2012 18:26:59 -0000 Author: jh Date: Mon Feb 13 18:26:58 2012 New Revision: 231591 URL: http://svn.freebsd.org/changeset/base/231591 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/9/sbin/mount/mount_fs.c Directory Properties: stable/9/sbin/mount/ (props changed) Modified: stable/9/sbin/mount/mount_fs.c ============================================================================== --- stable/9/sbin/mount/mount_fs.c Mon Feb 13 18:10:13 2012 (r231590) +++ stable/9/sbin/mount/mount_fs.c Mon Feb 13 18:26:58 2012 (r231591) @@ -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)); @@ -125,10 +124,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); }