diff options
author | Sachin Sant <sachinp@linux.vnet.ibm.com> | 2020-11-06 10:40:06 +0300 |
---|---|---|
committer | Shuah Khan <skhan@linuxfoundation.org> | 2020-11-11 01:13:25 +0300 |
commit | c2e46f6b3e3551558d44c4dc518b9667cb0d5f8b (patch) | |
tree | 65206eb07fea969353787cfe708262b5d4d7c8ec /tools/testing/selftests/cgroup | |
parent | 93f20eff0cca972d74cb554a2e8b47730228be16 (diff) | |
download | linux-c2e46f6b3e3551558d44c4dc518b9667cb0d5f8b.tar.xz |
selftests/cgroup: Fix build on older distros
On older distros struct clone_args does not have a cgroup member,
leading to build errors:
cgroup_util.c: In function 'clone_into_cgroup':
cgroup_util.c:343:4: error: 'struct clone_args' has no member named 'cgroup'
cgroup_util.c:346:33: error: invalid application of 'sizeof' to incomplete
type 'struct clone_args'
But the selftests already have a locally defined version of the
structure which is up to date, called __clone_args.
So use __clone_args which fixes the error.
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Sachin Sant <sachinp@linux.vnet.ibm.com>>
Acked-by: Christian Brauner <christian.brauner@ubuntu.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
Diffstat (limited to 'tools/testing/selftests/cgroup')
-rw-r--r-- | tools/testing/selftests/cgroup/cgroup_util.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/testing/selftests/cgroup/cgroup_util.c b/tools/testing/selftests/cgroup/cgroup_util.c index 05853b0b8831..027014662fb2 100644 --- a/tools/testing/selftests/cgroup/cgroup_util.c +++ b/tools/testing/selftests/cgroup/cgroup_util.c @@ -337,13 +337,13 @@ pid_t clone_into_cgroup(int cgroup_fd) #ifdef CLONE_ARGS_SIZE_VER2 pid_t pid; - struct clone_args args = { + struct __clone_args args = { .flags = CLONE_INTO_CGROUP, .exit_signal = SIGCHLD, .cgroup = cgroup_fd, }; - pid = sys_clone3(&args, sizeof(struct clone_args)); + pid = sys_clone3(&args, sizeof(struct __clone_args)); /* * Verify that this is a genuine test failure: * ENOSYS -> clone3() not available |