From b248125c5f2c4dcc59573b11f954945159e8442b Mon Sep 17 00:00:00 2001 From: ndrewh Date: Wed, 3 Nov 2021 21:17:18 -0400 Subject: [PATCH] Fix compile using `FROM ubuntu:20.04` Remove clone_args members that are only present in 5.5+ and 5.7+ --- subproc.cc | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/subproc.cc b/subproc.cc index 0b33fd9..f1f77f1 100644 --- a/subproc.cc +++ b/subproc.cc @@ -526,19 +526,9 @@ pid_t cloneProc(uintptr_t flags, int exit_signal) { } #if defined(__NR_clone3) - struct clone_args ca = { - .flags = (uint64_t)flags, - .pidfd = 0, - .child_tid = 0, - .parent_tid = 0, - .exit_signal = (uint64_t)exit_signal, - .stack = 0, - .stack_size = 0, - .tls = 0, - .set_tid = 0, - .set_tid_size = 0, - .cgroup = 0, - }; + struct clone_args ca = {}; + ca.flags = (uint64_t)flags; + ca.exit_signal = (uint64_t)exit_signal; pid_t ret = util::syscall(__NR_clone3, (uintptr_t)&ca, sizeof(ca)); if (ret != -1 || errno != ENOSYS) {