usr/src/cmd/zfs/zfs_main.c
changeset 5904 ac17ccc8902b
parent 5749 78a7afaea267
child 5993 6309c3c0a28f
--- a/usr/src/cmd/zfs/zfs_main.c	Thu Jan 24 14:49:21 2008 -0800
+++ b/usr/src/cmd/zfs/zfs_main.c	Thu Jan 24 15:00:53 2008 -0800
@@ -20,7 +20,7 @@
  */
 
 /*
- * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
+ * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
 
@@ -3385,9 +3385,17 @@
 			break;
 	}
 	if (ret != 0) {
-		(void) fprintf(stderr, gettext("cannot %s '%s': not "
-		    "currently mounted\n"), cmdname, path);
-		return (1);
+		if (op == OP_SHARE) {
+			(void) fprintf(stderr, gettext("cannot %s '%s': not "
+			    "currently mounted\n"), cmdname, path);
+			return (1);
+		}
+		(void) fprintf(stderr, gettext("warning: %s not in mnttab\n"),
+		    path);
+		if ((ret = umount2(path, flags)) != 0)
+			(void) fprintf(stderr, gettext("%s: %s\n"), path,
+			    strerror(errno));
+		return (ret != 0);
 	}
 
 	if (strcmp(entry.mnt_fstype, MNTTYPE_ZFS) != 0) {