Skip to content

Commit

Permalink
Use the correct return type for getopt
Browse files Browse the repository at this point in the history
Use the correct return type for getopt otherwise clang complains
about tautological-constant-out-of-range-compare.

Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Sterling Jensen <[email protected]>
Closes #11359
  • Loading branch information
sterlingjensen authored Dec 17, 2020
1 parent be5c6d9 commit fb18840
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion cmd/zfs/zfs_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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++)
Expand Down
2 changes: 1 addition & 1 deletion cmd/zfs_ids_to_path/zfs_ids_to_path.c
Original file line number Diff line number Diff line change
Expand Up @@ -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':
Expand Down
2 changes: 1 addition & 1 deletion cmd/zpool/zpool_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion cmd/zstream/zstream_redup.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion tests/zfs-tests/cmd/btree_test/btree_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit fb18840

Please sign in to comment.