summaryrefslogtreecommitdiffstats
path: root/cddl
diff options
context:
space:
mode:
Diffstat (limited to 'cddl')
-rw-r--r--cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c b/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c
index e1cbae3..e328711 100644
--- a/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c
+++ b/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c
@@ -4207,10 +4207,13 @@ zfs_hold(zfs_handle_t *zhp, const char *snapname, const char *tag,
if (nvlist_next_nvpair(ha.nvl, NULL) == NULL) {
fnvlist_free(ha.nvl);
ret = ENOENT;
- (void) snprintf(errbuf, sizeof (errbuf),
- dgettext(TEXT_DOMAIN, "cannot hold snapshot '%s@%s'"),
- zhp->zfs_name, snapname);
- (void) zfs_standard_error(hdl, ret, errbuf);
+ if (!enoent_ok) {
+ (void) snprintf(errbuf, sizeof (errbuf),
+ dgettext(TEXT_DOMAIN,
+ "cannot hold snapshot '%s@%s'"),
+ zhp->zfs_name, snapname);
+ (void) zfs_standard_error(hdl, ret, errbuf);
+ }
return (ret);
}
OpenPOWER on IntegriCloud