libnvpair: Support prefixed nvlist symbol names as found on NetBSD

NetBSD uses slightly different function names for the same functions.

Signed-off-by: Vladimir Serbinenko <phcoder@gmail.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
This commit is contained in:
Vladimir Serbinenko authored and Daniel Kiper committed 2023-12-13 13:30:33 +01:00
1 parent a13df3d15a
commit f20123072a
3 files changed
+26 -9

No files matched your search

+4 -4
View File
@@ -174,20 +174,20 @@ grub_util_find_root_devices_from_poolname (char *poolname)
zpool = zpool_open (libzfs, poolname);
config = zpool_get_config (zpool, NULL);
if (nvlist_lookup_nvlist (config, "vdev_tree", &vdev_tree) != 0)
if (NVLIST(lookup_nvlist) (config, "vdev_tree", &vdev_tree) != 0)
error (1, errno, "nvlist_lookup_nvlist (\"vdev_tree\")");
if (nvlist_lookup_nvlist_array (vdev_tree, "children", &children, &nvlist_count) != 0)
if (NVLIST(lookup_nvlist_array) (vdev_tree, "children", &children, &nvlist_count) != 0)
error (1, errno, "nvlist_lookup_nvlist_array (\"children\")");
assert (nvlist_count > 0);
while (nvlist_lookup_nvlist_array (children[0], "children",
while (NVLIST(lookup_nvlist_array) (children[0], "children",
&children, &nvlist_count) == 0)
assert (nvlist_count > 0);
for (i = 0; i < nvlist_count; i++)
{
if (nvlist_lookup_string (children[i], "path", &device) != 0)
if (NVLIST(lookup_string) (children[i], "path", &device) != 0)
error (1, errno, "nvlist_lookup_string (\"path\")");
struct stat st;