]> git.proxmox.com Git - mirror_zfs.git/commitdiff
Use the correct return type for getopt
authorsterlingjensen <5555776+sterlingjensen@users.noreply.github.com>
Thu, 17 Dec 2020 18:19:30 +0000 (12:19 -0600)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Wed, 23 Dec 2020 22:34:59 +0000 (14:34 -0800)
Use the correct return type for getopt otherwise clang complains
about tautological-constant-out-of-range-compare.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Sterling Jensen <sterlingjensen@users.noreply.github.com>
Closes #11359

cmd/zfs/zfs_main.c
cmd/zfs_ids_to_path/zfs_ids_to_path.c
cmd/zpool/zpool_main.c
cmd/zstream/zstream_redup.c
tests/zfs-tests/cmd/btree_test/btree_test.c

index f609a4e70677a5bb9494579e35e9939a2c9bf733..2dad91c081fa756cdc82efd8de76489d76efd9e9 100644 (file)
@@ -8370,7 +8370,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++)
index 6cfaa6f41fa55cb66e3f65877587ebc09e25e115..80dd5bf2dc2e642a0c3d0e828c7ffea9af4ece5f 100644 (file)
@@ -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':
index 1377c890a5abc24041835a85a1435b532e187878..2ddb0f66b4c1315c40e1f79b9b56997e6f7708ee 100644 (file)
@@ -10062,7 +10062,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;
index 379025ce59e5a18eb2117b96ec2bef8f350ccb1b..41f1068e3dfc274812adf904237787c5ceaefdc7 100644 (file)
@@ -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) {
index e1995c03af3e36262e40b226aec0660a7f3699ca..8de14ff2a2663eebec95c52e34d4c1572bccba84 100644 (file)
@@ -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) {