From fb188409f1b60390e3c8e4bbb18f887be44887e1 Mon Sep 17 00:00:00 2001 From: sterlingjensen <5555776+sterlingjensen@users.noreply.github.com> Date: Thu, 17 Dec 2020 12:19:30 -0600 Subject: [PATCH] Use the correct return type for getopt Use the correct return type for getopt otherwise clang complains about tautological-constant-out-of-range-compare. Reviewed-by: Brian Behlendorf Signed-off-by: Sterling Jensen Closes #11359 --- cmd/zfs/zfs_main.c | 2 +- cmd/zfs_ids_to_path/zfs_ids_to_path.c | 2 +- cmd/zpool/zpool_main.c | 2 +- cmd/zstream/zstream_redup.c | 2 +- tests/zfs-tests/cmd/btree_test/btree_test.c | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cmd/zfs/zfs_main.c b/cmd/zfs/zfs_main.c index 8064f63639..ab2b006ae4 100644 --- a/cmd/zfs/zfs_main.c +++ b/cmd/zfs/zfs_main.c @@ -8492,7 +8492,7 @@ zfs_do_wait(int argc, char **argv) { boolean_t enabled[ZFS_WAIT_NUM_ACTIVITIES]; int error, i; - char c; + int c; /* By default, wait for all types of activity. */ for (i = 0; i < ZFS_WAIT_NUM_ACTIVITIES; i++) diff --git a/cmd/zfs_ids_to_path/zfs_ids_to_path.c b/cmd/zfs_ids_to_path/zfs_ids_to_path.c index 6cfaa6f41f..80dd5bf2dc 100644 --- a/cmd/zfs_ids_to_path/zfs_ids_to_path.c +++ b/cmd/zfs_ids_to_path/zfs_ids_to_path.c @@ -44,7 +44,7 @@ int main(int argc, char **argv) { boolean_t verbose = B_FALSE; - char c; + int c; while ((c = getopt(argc, argv, "v")) != -1) { switch (c) { case 'v': diff --git a/cmd/zpool/zpool_main.c b/cmd/zpool/zpool_main.c index c84f30ccb1..e00fdb7ae1 100644 --- a/cmd/zpool/zpool_main.c +++ b/cmd/zpool/zpool_main.c @@ -10147,7 +10147,7 @@ int zpool_do_wait(int argc, char **argv) { boolean_t verbose = B_FALSE; - char c; + int c; char *value; int i; unsigned long count; diff --git a/cmd/zstream/zstream_redup.c b/cmd/zstream/zstream_redup.c index 379025ce59..41f1068e3d 100644 --- a/cmd/zstream/zstream_redup.c +++ b/cmd/zstream/zstream_redup.c @@ -421,7 +421,7 @@ int zstream_do_redup(int argc, char *argv[]) { boolean_t verbose = B_FALSE; - char c; + int c; while ((c = getopt(argc, argv, "v")) != -1) { switch (c) { diff --git a/tests/zfs-tests/cmd/btree_test/btree_test.c b/tests/zfs-tests/cmd/btree_test/btree_test.c index e1995c03af..8de14ff2a2 100644 --- a/tests/zfs-tests/cmd/btree_test/btree_test.c +++ b/tests/zfs-tests/cmd/btree_test/btree_test.c @@ -457,7 +457,7 @@ main(int argc, char *argv[]) int failed_tests = 0; struct timeval tp; zfs_btree_t bt; - char c; + int c; while ((c = getopt(argc, argv, "c:l:n:r:st:")) != -1) { switch (c) {