svn commit: r244857 - head/cddl/contrib/opensolaris/cmd/zpool

Pawel Jakub Dawidek pjd at FreeBSD.org
Sun Dec 30 13:47:40 UTC 2012


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;
 


More information about the svn-src-head mailing list