Skip to content

Commit

Permalink
5847 libzfs_diff should check zfs_prop_get() return
Browse files Browse the repository at this point in the history
Reviewed by: Matthew Ahrens <[email protected]>
Reviewed by: Albert Lee <[email protected]>
Approved by: Dan McDonald <[email protected]>
  • Loading branch information
alhazred authored and Dan McDonald committed Apr 24, 2015
1 parent 3c799a5 commit 8430278
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions usr/src/lib/libzfs/common/libzfs_diff.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

/*
* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright 2015 Nexenta Systems, Inc. All rights reserved.
*/

/*
Expand Down Expand Up @@ -616,9 +617,12 @@ get_snapshot_names(differ_info_t *di, const char *fromsnap,

zhp = zfs_open(hdl, di->ds, ZFS_TYPE_FILESYSTEM);
while (zhp != NULL) {
(void) zfs_prop_get(zhp, ZFS_PROP_ORIGIN,
origin, sizeof (origin), &src, NULL, 0, B_FALSE);

if (zfs_prop_get(zhp, ZFS_PROP_ORIGIN, origin,
sizeof (origin), &src, NULL, 0, B_FALSE) != 0) {
(void) zfs_close(zhp);
zhp = NULL;
break;
}
if (strncmp(origin, fromsnap, fsnlen) == 0)
break;

Expand Down

0 comments on commit 8430278

Please sign in to comment.