configure: Improve the ibverbs test
authorBart Van Assche <bvanassche@acm.org>
Mon, 6 Jan 2020 18:55:48 +0000 (10:55 -0800)
committerBart Van Assche <bvanassche@acm.org>
Mon, 6 Jan 2020 19:01:38 +0000 (11:01 -0800)
This patch fixes the following configure test build error if configure is
invoked with --extra-cflags=-Werror:

/tmp/fio-conf-14710-130227-4466.c: In function 'main':
/tmp/fio-conf-14710-130227-4466.c:4:18: error: unused variable 'pd' [-Werror=unused-variable]
   struct ibv_pd *pd = ibv_alloc_pd(NULL);
                  ^~
cc1: all warnings being treated as errors

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
configure

index fa6df532f0a70092e4fbbcb0e13c6190af3d3e9a..65ce36623126dd1c44c7dd2d27e8ad0d2d86ad9e 100755 (executable)
--- a/configure
+++ b/configure
@@ -841,7 +841,7 @@ cat > $TMPC << EOF
 int main(int argc, char **argv)
 {
   struct ibv_pd *pd = ibv_alloc_pd(NULL);
-  return 0;
+  return pd != NULL;
 }
 EOF
 if test "$disable_rdma" != "yes" && compile_prog "" "-libverbs" "libverbs" ; then