summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThiago Becker <tbecker@redhat.com>2022-05-26 12:05:08 -0400
committerSteve Dickson <steved@redhat.com>2022-05-26 13:11:57 -0400
commitf347c3c8c605b874733019685b7f8ae84e86b55e (patch)
tree35719f47992d06ac05904f778fd15a55eab2e7c1
parent18ac9c85d49d081dcfac8ba6ca63b4adc07c8ac6 (diff)
downloadnfs-utils-f347c3c8c605b874733019685b7f8ae84e86b55e.tar.gz
nfsrahead: getopt return type is int
While compiling for aarch64, the compiler throws the warning below because char is unsigned for aarch64. main.c: In function ?main?: main.c:145:48: warning: comparison is always true due to limited range of data type [-Wtype-limits] 145 | while((opt = getopt(argc, argv, "dF")) != -1) { | This makes nfsrahead to run forever. Fix opt type to the same as getopt type. Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2083926 Signed-off-by: Thiago Becker <tbecker@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
-rw-r--r--tools/nfsrahead/main.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/tools/nfsrahead/main.c b/tools/nfsrahead/main.c
index 5fae941..c83c6f7 100644
--- a/tools/nfsrahead/main.c
+++ b/tools/nfsrahead/main.c
@@ -135,10 +135,9 @@ static int conf_get_readahead(const char *kind) {
int main(int argc, char **argv)
{
- int ret = 0, retry;
+ int ret = 0, retry, opt;
struct device_info device;
unsigned int readahead = 128, log_level, log_stderr = 0;
- char opt;
log_level = D_ALL & ~D_GENERAL;