cmd/zpool cstyle issues

add missing headers.
usage() is no-return, so anything after call to it is unreachable code.
use (void) cast where we do ignore return value.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Toomas Soome <tsoome@me.com>
Closes #17885
This commit is contained in:
Toomas Soome 2025-11-15 01:58:50 +02:00 committed by Brian Behlendorf
parent 099f69ff5d
commit 040c533280
2 changed files with 228 additions and 191 deletions

File diff suppressed because it is too large Load Diff

View File

@ -195,7 +195,7 @@ is_shorthand_path(const char *arg, char *path, size_t path_size,
return (0); return (0);
} }
strlcpy(path, arg, path_size); (void) strlcpy(path, arg, path_size);
memset(statbuf, 0, sizeof (*statbuf)); memset(statbuf, 0, sizeof (*statbuf));
*wholedisk = B_FALSE; *wholedisk = B_FALSE;
@ -308,7 +308,7 @@ make_leaf_vdev(const char *arg, boolean_t is_primary, uint64_t ashift)
} }
/* After whole disk check restore original passed path */ /* After whole disk check restore original passed path */
strlcpy(path, arg, sizeof (path)); (void) strlcpy(path, arg, sizeof (path));
} else if (zpool_is_draid_spare(arg)) { } else if (zpool_is_draid_spare(arg)) {
if (!is_primary) { if (!is_primary) {
(void) fprintf(stderr, (void) fprintf(stderr,
@ -318,7 +318,7 @@ make_leaf_vdev(const char *arg, boolean_t is_primary, uint64_t ashift)
} }
wholedisk = B_TRUE; wholedisk = B_TRUE;
strlcpy(path, arg, sizeof (path)); (void) strlcpy(path, arg, sizeof (path));
type = VDEV_TYPE_DRAID_SPARE; type = VDEV_TYPE_DRAID_SPARE;
} else { } else {
err = is_shorthand_path(arg, path, sizeof (path), err = is_shorthand_path(arg, path, sizeof (path),
@ -1010,7 +1010,7 @@ make_disks(zpool_handle_t *zhp, nvlist_t *nv, boolean_t replacing)
* window between when udev deletes and recreates the link * window between when udev deletes and recreates the link
* during which access attempts will fail with ENOENT. * during which access attempts will fail with ENOENT.
*/ */
strlcpy(udevpath, path, MAXPATHLEN); (void) strlcpy(udevpath, path, MAXPATHLEN);
(void) zfs_append_partition(udevpath, MAXPATHLEN); (void) zfs_append_partition(udevpath, MAXPATHLEN);
fd = open(devpath, O_RDWR|O_EXCL); fd = open(devpath, O_RDWR|O_EXCL);