From 4c7da8a825fac8ab5cdd43370b49a7e1719eeb20 Mon Sep 17 00:00:00 2001 From: Daan De Meyer Date: Thu, 25 Jan 2024 12:52:37 +0100 Subject: [PATCH 1/2] Define _GNU_SOURCE before including xfs/xqm.h Required as xfs/xqm.h uses fallocate() which is only defined when _GNU_SOURCE is defined. --- configure.ac | 5 ++++- testcases/kernel/syscalls/quotactl/quotactl07.c | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 1d7e862d88f..59527da104c 100644 --- a/configure.ac +++ b/configure.ac @@ -179,7 +179,10 @@ AC_CHECK_TYPES([struct file_handle],,,[ #include ]) -AC_CHECK_TYPES([struct fs_quota_statv],,,[#include ]) +AC_CHECK_TYPES([struct fs_quota_statv],,,[ +#define _GNU_SOURCE +#include +]) AC_CHECK_TYPES([struct if_nextdqblk],,,[#include ]) AC_CHECK_TYPES([struct iovec],,,[#include ]) AC_CHECK_TYPES([struct ipc64_perm],,,[#include ]) diff --git a/testcases/kernel/syscalls/quotactl/quotactl07.c b/testcases/kernel/syscalls/quotactl/quotactl07.c index 34ff2705dd4..37b5a12a617 100644 --- a/testcases/kernel/syscalls/quotactl/quotactl07.c +++ b/testcases/kernel/syscalls/quotactl/quotactl07.c @@ -13,6 +13,7 @@ * ("xfs: Sanity check flags of Q_XQUOTARM call"). */ +#define _GNU_SOURCE 1 #include #include #include From 8257f08b91be3b4bca1b3d1e4ee2573479400ec5 Mon Sep 17 00:00:00 2001 From: Daan De Meyer Date: Thu, 25 Jan 2024 13:15:23 +0100 Subject: [PATCH 2/2] Cast result of svc_getcaller() This might be either an ipv4 or an ipv6 sockaddr to let's use "struct sockaddr *" and make sure we cast properly so we don't get compilation errors about incompatible pointers. --- .../network/rpc/rpc-tirpc/tests_pack/rpc_svc_1/rpc_svc_1.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_svc_1/rpc_svc_1.c b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_svc_1/rpc_svc_1.c index d1c4df97f94..7773e3a7e2f 100644 --- a/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_svc_1/rpc_svc_1.c +++ b/testcases/network/rpc/rpc-tirpc/tests_pack/rpc_svc_1/rpc_svc_1.c @@ -103,10 +103,10 @@ char *simplePing(union u_argument *inVar, SVCXPRT * transp) char *svc_getcaller_test(union u_argument *inVar, SVCXPRT * transp) { //In this function we test svc_getcaller function basically (simple call) - struct sockaddr_in *sa = NULL; + struct sockaddr *sa = NULL; static int result; - sa = svc_getcaller(transp); + sa = (struct sockaddr *) svc_getcaller(transp); //If the result is not NULL we consider that function call succeeds //so returns 0 (PASS) result = (sa != NULL) ? 0 : 1;