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 <behlendorf1@llnl.gov>
Reviewed-by: George Wilson <gwilson@delphix.com>
Signed-off-by: Ryan Moeller <ryan@iXsystems.com>
Closes #10539
This commit is contained in:
Ryan Moeller
2020-07-09 20:47:12 -04:00
committed by GitHub
parent fb91f0367e
commit 659f4008be
3 changed files with 8 additions and 6 deletions
+3 -2
View File
@@ -293,7 +293,7 @@ lzc_promote(const char *fsname, char *snapnamebuf, int snapnamelen)
* The promote ioctl is still legacy, so we need to construct our
* own zfs_cmd_t rather than using lzc_ioctl().
*/
zfs_cmd_t zc = { "\0" };
zfs_cmd_t zc = {"\0"};
ASSERT3S(g_refcount, >, 0);
VERIFY3S(g_fd, !=, -1);
@@ -311,8 +311,9 @@ lzc_promote(const char *fsname, char *snapnamebuf, int snapnamelen)
int
lzc_rename(const char *source, const char *target)
{
zfs_cmd_t zc = { "\0" };
zfs_cmd_t zc = {"\0"};
int error;
ASSERT3S(g_refcount, >, 0);
VERIFY3S(g_fd, !=, -1);
(void) strlcpy(zc.zc_name, source, sizeof (zc.zc_name));