diff options
author | pjd <pjd@FreeBSD.org> | 2012-12-30 13:47:40 +0000 |
---|---|---|
committer | pjd <pjd@FreeBSD.org> | 2012-12-30 13:47:40 +0000 |
commit | f250bca4bbed2a7b99a98f3e8357027d7bd22bec (patch) | |
tree | 8a471ccacb2ecb6e388a7a9b353b3f1723463897 /cddl | |
parent | eeb266c4b7315ad09e842f1f68ffc069e25ce0fb (diff) | |
download | FreeBSD-src-f250bca4bbed2a7b99a98f3e8357027d7bd22bec.zip FreeBSD-src-f250bca4bbed2a7b99a98f3e8357027d7bd22bec.tar.gz |
Allow to create pool even if mount point directory is not empty if -f is given.
Obtained from: WHEEL Systems
Diffstat (limited to 'cddl')
-rw-r--r-- | cddl/contrib/opensolaris/cmd/zpool/zpool_main.c | 5 |
1 files changed, 3 insertions, 2 deletions
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; |