summaryrefslogtreecommitdiff
path: root/usr/src/cmd/zfs/zfs_main.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr/src/cmd/zfs/zfs_main.c')
-rw-r--r--usr/src/cmd/zfs/zfs_main.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/usr/src/cmd/zfs/zfs_main.c b/usr/src/cmd/zfs/zfs_main.c
index f7cb699692..4a221b4d38 100644
--- a/usr/src/cmd/zfs/zfs_main.c
+++ b/usr/src/cmd/zfs/zfs_main.c
@@ -20,7 +20,7 @@
* CDDL HEADER END
*/
/*
- * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -2226,13 +2226,17 @@ unshare_unmount_path(int type, char *path, int flags, int is_manual)
ret = zfs_unshareall(zhp);
}
} else {
- if (strcmp(property, "legacy") == 0 && !is_manual) {
- (void) fprintf(stderr, gettext("cannot unmount "
- "'%s': legacy mountpoint\n"),
- zfs_get_name(zhp));
- (void) fprintf(stderr, gettext("use umount(1M) "
- "to unmount this filesystem\n"));
- ret = 1;
+ if (strcmp(property, "legacy") == 0) {
+ if (is_manual) {
+ ret = zfs_unmount(zhp, NULL, flags);
+ } else {
+ (void) fprintf(stderr, gettext("cannot unmount "
+ "'%s': legacy mountpoint\n"),
+ zfs_get_name(zhp));
+ (void) fprintf(stderr, gettext("use umount(1M) "
+ "to unmount this filesystem\n"));
+ ret = 1;
+ }
} else {
ret = zfs_unmountall(zhp, flags);
}