Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 3 Aug 2018 01:43:52 +0000 (UTC)
From:      Kyle Evans <kevans@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject:   svn commit: r337224 - projects/bectl/lib/libbe
Message-ID:  <201808030143.w731hqoW086155@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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",



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201808030143.w731hqoW086155>