From f250bca4bbed2a7b99a98f3e8357027d7bd22bec Mon Sep 17 00:00:00 2001 From: pjd Date: Sun, 30 Dec 2012 13:47:40 +0000 Subject: Allow to create pool even if mount point directory is not empty if -f is given. Obtained from: WHEEL Systems --- cddl/contrib/opensolaris/cmd/zpool/zpool_main.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'cddl') diff --git a/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c b/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c index 3c2a625..dd6c90b 100644 --- a/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c +++ b/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c @@ -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; -- cgit v1.1