aboutsummaryrefslogtreecommitdiffstats
path: root/lib/libzfs/os
diff options
context:
space:
mode:
authorRyan Moeller <[email protected]>2020-07-09 20:47:12 -0400
committerGitHub <[email protected]>2020-07-09 17:47:12 -0700
commit659f4008be86d5eaf67184c83fddbcb6800a3705 (patch)
treefdf08b835f036236ac714fcd32ab3af966c062ee /lib/libzfs/os
parentfb91f0367e91fb74a391f56d80fa3d3a9c6a2902 (diff)
libzfs: Make zfs_cmd_t initialization consistent, use zfs_ioctl
The clang version 8.0.1 shipped in FreeBSD 12.1-RELEASE also oddly throws a warning that is treated as an error on the initialization of the zc struct in zpool_nextboot. The zpool_nextboot code from FreeBSD was not updated to use zfs_ioctl. Switch ioctl to zfs_ioctl in and use {"\0"} to initialize the struct. Do a consistency pass for zfs_cmd_t initialization. Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: George Wilson <[email protected]> Signed-off-by: Ryan Moeller <[email protected]> Closes #10539
Diffstat (limited to 'lib/libzfs/os')
-rw-r--r--lib/libzfs/os/freebsd/libzfs_compat.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/libzfs/os/freebsd/libzfs_compat.c b/lib/libzfs/os/freebsd/libzfs_compat.c
index 50a3c7b77..98269b57b 100644
--- a/lib/libzfs/os/freebsd/libzfs_compat.c
+++ b/lib/libzfs/os/freebsd/libzfs_compat.c
@@ -230,7 +230,7 @@ int
zfs_jail(zfs_handle_t *zhp, int jailid, int attach)
{
libzfs_handle_t *hdl = zhp->zfs_hdl;
- zfs_cmd_t zc = { { 0 } };
+ zfs_cmd_t zc = {"\0"};
char errbuf[1024];
unsigned long cmd;
int ret;
@@ -281,7 +281,7 @@ int
zpool_nextboot(libzfs_handle_t *hdl, uint64_t pool_guid, uint64_t dev_guid,
const char *command)
{
- zfs_cmd_t zc = { 0 };
+ zfs_cmd_t zc = {"\0"};
nvlist_t *args;
int error;
@@ -291,7 +291,7 @@ zpool_nextboot(libzfs_handle_t *hdl, uint64_t pool_guid, uint64_t dev_guid,
fnvlist_add_string(args, "command", command);
error = zcmd_write_src_nvlist(hdl, &zc, args);
if (error == 0)
- error = ioctl(hdl->libzfs_fd, ZFS_IOC_NEXTBOOT, &zc);
+ error = zfs_ioctl(hdl, ZFS_IOC_NEXTBOOT, &zc);
zcmd_free_nvlists(&zc);
nvlist_free(args);
return (error);