diff options
author | Damian Szuberski <[email protected]> | 2022-02-21 04:20:00 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2022-02-20 19:20:00 -0800 |
commit | 806739f991aa0d3fc5a36989fff8d8ab8fddf78f (patch) | |
tree | c486b2dd5f9d9ade96b7e5e897193607fcaa241d /lib/libzfs/libzfs_dataset.c | |
parent | e41013078a90d5790c737eec573ec376ca21a234 (diff) |
Correct compilation errors reported by GCC 10/11
New `zfs_type_t` value `ZFS_TYPE_INVALID` is introduced.
Variable initialization is now possible to make GCC happy.
Reviewed by: Brian Behlendorf <[email protected]>
Signed-off-by: szubersk <[email protected]>
Closes #12167
Closes #13103
Diffstat (limited to 'lib/libzfs/libzfs_dataset.c')
-rw-r--r-- | lib/libzfs/libzfs_dataset.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/lib/libzfs/libzfs_dataset.c b/lib/libzfs/libzfs_dataset.c index ba120c244..3236ada25 100644 --- a/lib/libzfs/libzfs_dataset.c +++ b/lib/libzfs/libzfs_dataset.c @@ -3972,13 +3972,10 @@ zfs_clone(zfs_handle_t *zhp, const char *target, nvlist_t *props) /* do the clone */ if (props) { - zfs_type_t type; + zfs_type_t type = ZFS_TYPE_FILESYSTEM; - if (ZFS_IS_VOLUME(zhp)) { + if (ZFS_IS_VOLUME(zhp)) type = ZFS_TYPE_VOLUME; - } else { - type = ZFS_TYPE_FILESYSTEM; - } if ((props = zfs_valid_proplist(hdl, type, props, zoned, zhp, zhp->zpool_hdl, B_TRUE, errbuf)) == NULL) return (-1); |