Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 30 Dec 2012 13:47:40 +0000 (UTC)
From:      Pawel Jakub Dawidek <pjd@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r244857 - head/cddl/contrib/opensolaris/cmd/zpool
Message-ID:  <201212301347.qBUDleZn012109@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: pjd
Date: Sun Dec 30 13:47:40 2012
New Revision: 244857
URL: http://svnweb.freebsd.org/changeset/base/244857

Log:
  Allow to create pool even if mount point directory is not empty if -f is given.
  
  Obtained from:	WHEEL Systems

Modified:
  head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c

Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c
==============================================================================
--- head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c	Sun Dec 30 08:16:05 2012	(r244856)
+++ head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c	Sun Dec 30 13:47:40 2012	(r244857)
@@ -906,10 +906,11 @@ zpool_do_create(int argc, char **argv)
 	/*
 	 * Check the validity of the mountpoint and direct the user to use the
 	 * '-m' mountpoint option if it looks like its in use.
+	 * Ignore the checks if the '-f' option is given.
 	 */
-	if (mountpoint == NULL ||
+	if (!force && (mountpoint == NULL ||
 	    (strcmp(mountpoint, ZFS_MOUNTPOINT_LEGACY) != 0 &&
-	    strcmp(mountpoint, ZFS_MOUNTPOINT_NONE) != 0)) {
+	    strcmp(mountpoint, ZFS_MOUNTPOINT_NONE) != 0))) {
 		char buf[MAXPATHLEN];
 		DIR *dirp;
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201212301347.qBUDleZn012109>