Blob Blame History Raw
From a846db7bde6f756e320035da7cfe4d78e62e2a87 Mon Sep 17 00:00:00 2001
From: Honggang Li <honli@redhat.com>
Date: Tue, 25 Apr 2017 13:28:41 +0800
Subject: [PATCH] Use integer as getopt_long returns integer

ARM chars are unsigned by default. getopt_long return 255 instead -1.
That will cause an endless loop for aarch64 platform.

Signed-off-by: Honggang Li <honli@redhat.com>
---
 rdma-ndd/rdma-ndd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/rdma-ndd/rdma-ndd.c b/rdma-ndd/rdma-ndd.c
index 1579a02..e7be22b 100644
--- a/rdma-ndd/rdma-ndd.c
+++ b/rdma-ndd/rdma-ndd.c
@@ -297,7 +297,7 @@ int main(int argc, char *argv[])
 			{ }
 		};
 
-		char c = getopt_long(argc, argv, "fh", long_opts, &opt_idx);
+		int c = getopt_long(argc, argv, "fh", long_opts, &opt_idx);
 		if (c == -1)
 			break;
 
-- 
1.8.3.1