svn commit: r337224 - projects/bectl/lib/libbe

Kyle Evans kevans at FreeBSD.org
Fri Aug 3 01:43:53 UTC 2018


Author: kevans
Date: Fri Aug  3 01:43:51 2018
New Revision: 337224
URL: https://svnweb.freebsd.org/changeset/base/337224

Log:
  libbe(3): Fix checking of zfs_prop_get's return value
  
  Rather than a boolean_t, it returns an int != 0 for error or 0 for OK.

Modified:
  projects/bectl/lib/libbe/be_info.c

Modified: projects/bectl/lib/libbe/be_info.c
==============================================================================
--- projects/bectl/lib/libbe/be_info.c	Fri Aug  3 01:37:14 2018	(r337223)
+++ projects/bectl/lib/libbe/be_info.c	Fri Aug  3 01:43:51 2018	(r337224)
@@ -136,34 +136,34 @@ prop_list_builder_cb(zfs_handle_t *zfs_hdl, void *data
 		nvlist_add_string(props, "mountpoint", mountpoint);
 
 	if (zfs_prop_get(zfs_hdl, ZFS_PROP_ORIGIN, buf, 512,
-	    NULL, NULL, 0, 1))
+	    NULL, NULL, 0, 1) == 0)
 		nvlist_add_string(props, "origin", buf);
 
 	if (zfs_prop_get(zfs_hdl, ZFS_PROP_CREATION, buf, 512,
-	    NULL, NULL, 0, 1))
+	    NULL, NULL, 0, 1) == 0)
 		nvlist_add_string(props, "creation", buf);
 
 	nvlist_add_boolean_value(props, "active",
 	    (strcmp(be_active_path(lbh), dataset) == 0));
 
 	if (zfs_prop_get(zfs_hdl, ZFS_PROP_USED, buf, 512,
-	    NULL, NULL, 0, 1))
+	    NULL, NULL, 0, 1) == 0)
 		nvlist_add_string(props, "used", buf);
 
 	if (zfs_prop_get(zfs_hdl, ZFS_PROP_USEDDS, buf, 512,
-	    NULL, NULL, 0, 1))
+	    NULL, NULL, 0, 1) == 0)
 		nvlist_add_string(props, "usedds", buf);
 
 	if (zfs_prop_get(zfs_hdl, ZFS_PROP_USEDSNAP, buf, 512,
-	    NULL, NULL, 0, 1))
+	    NULL, NULL, 0, 1) == 0)
 		nvlist_add_string(props, "usedsnap", buf);
 
 	if (zfs_prop_get(zfs_hdl, ZFS_PROP_USEDREFRESERV, buf, 512,
-	    NULL, NULL, 0, 1))
+	    NULL, NULL, 0, 1) == 0)
 		nvlist_add_string(props, "usedrefreserv", buf);
 
 	if (zfs_prop_get(zfs_hdl, ZFS_PROP_REFERENCED, buf, 512,
-	    NULL, NULL, 0, 1))
+	    NULL, NULL, 0, 1) == 0)
 		nvlist_add_string(props, "referenced", buf);
 
 	nvlist_add_boolean_value(props, "nextboot",


More information about the svn-src-projects mailing list