X-Git-Url: https://git.camperquake.de/gitweb.cgi?a=blobdiff_plain;f=cmd%2Fzfs%2Fzfs_iter.c;h=e2ab90eaf14fc5be1234ae068604c0299a543e1d;hb=428870ff734fdaccc342b33fc53cf94724409a46;hp=ca5c2b232786de354d8d4984189b45bbf646f474;hpb=9babb37438b58e77bad04e820d5702e15b79e6a6;p=zfs.git diff --git a/cmd/zfs/zfs_iter.c b/cmd/zfs/zfs_iter.c index ca5c2b2..e2ab90e 100644 --- a/cmd/zfs/zfs_iter.c +++ b/cmd/zfs/zfs_iter.c @@ -19,8 +19,7 @@ * CDDL HEADER END */ /* - * Copyright 2009 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. */ #include @@ -107,7 +106,8 @@ zfs_callback(zfs_handle_t *zhp, void *data) zfs_prune_proplist(zhp, cb->cb_props_table); - if (zfs_expand_proplist(zhp, cb->cb_proplist) + if (zfs_expand_proplist(zhp, cb->cb_proplist, + (cb->cb_flags & ZFS_ITER_RECVD_PROPS)) != 0) { free(node); return (-1); @@ -350,11 +350,8 @@ zfs_for_each(int argc, char **argv, int flags, zfs_type_t types, avl_pool = uu_avl_pool_create("zfs_pool", sizeof (zfs_node_t), offsetof(zfs_node_t, zn_avlnode), zfs_sort, UU_DEFAULT); - if (avl_pool == NULL) { - (void) fprintf(stderr, - gettext("internal error: out of memory\n")); - exit(1); - } + if (avl_pool == NULL) + nomem(); cb.cb_sortcol = sortcol; cb.cb_flags = flags; @@ -362,7 +359,7 @@ zfs_for_each(int argc, char **argv, int flags, zfs_type_t types, cb.cb_types = types; cb.cb_depth_limit = limit; /* - * If cb_proplist is provided then in the zfs_handles created we + * If cb_proplist is provided then in the zfs_handles created we * retain only those properties listed in cb_proplist and sortcol. * The rest are pruned. So, the caller should make sure that no other * properties other than those listed in cb_proplist/sortcol are @@ -399,11 +396,8 @@ zfs_for_each(int argc, char **argv, int flags, zfs_type_t types, sizeof (cb.cb_props_table)); } - if ((cb.cb_avl = uu_avl_create(avl_pool, NULL, UU_DEFAULT)) == NULL) { - (void) fprintf(stderr, - gettext("internal error: out of memory\n")); - exit(1); - } + if ((cb.cb_avl = uu_avl_create(avl_pool, NULL, UU_DEFAULT)) == NULL) + nomem(); if (argc == 0) { /* @@ -453,11 +447,8 @@ zfs_for_each(int argc, char **argv, int flags, zfs_type_t types, /* * Finally, clean up the AVL tree. */ - if ((walk = uu_avl_walk_start(cb.cb_avl, UU_WALK_ROBUST)) == NULL) { - (void) fprintf(stderr, - gettext("internal error: out of memory")); - exit(1); - } + if ((walk = uu_avl_walk_start(cb.cb_avl, UU_WALK_ROBUST)) == NULL) + nomem(); while ((node = uu_avl_walk_next(walk)) != NULL) { uu_avl_remove(cb.cb_avl, node);