Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix compilation errors #1124

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

DaanDeMeyer
Copy link

No description provided.

Required as xfs/xqm.h uses fallocate() which is only defined
when _GNU_SOURCE is defined.
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.
@@ -179,7 +179,10 @@ AC_CHECK_TYPES([struct file_handle],,,[
#include <fcntl.h>
])

AC_CHECK_TYPES([struct fs_quota_statv],,,[#include <xfs/xqm.h>])
AC_CHECK_TYPES([struct fs_quota_statv],,,[
#define _GNU_SOURCE
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What exactly you are trying to fix?

struct fs_quota_statv is not guarded by _GNU_SOURCE: https://git.kernel.org/pub/scm/fs/xfs/xfsprogs-dev.git/tree/include/xqm.h. Therefore my system check for struct fs_quota_statv works as is (without _GNU_SOURCE).

Quoting your commit message:

Required as xfs/xqm.h uses fallocate() which is only defined when _GNU_SOURCE is defined.`

None of our quotactl tests use fallocate().

I see only musl defines fallocate64 when _GNU_SOURCE defined, but I don't see how this could be used here.

#if defined(_GNU_SOURCE)
#define fallocate64 fallocate
#endif

@@ -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;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NOTE: IPv6 is not used at all, try to run rpc_test.sh with -6 and it fails, therefore this does not make sense unless you add rpc_test.sh support.

static int result;

sa = svc_getcaller(transp);
sa = (struct sockaddr *) svc_getcaller(transp);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The casting would be needed in many RPC tests:

$ git grep -l sockaddr_in testcases/network/rpc/ | wc -l
39

It would make sense to fix them all (with sed or awk scripting to make editing fast).
FYI TI-RPC tests are in terrible shape (code duplicity, lots of compiler warnings, useless comments), but upstream does not care.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants