From 7d9ba636a886b4be166c9a8d0615635e27b8d937 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+ cherry-picked upstream commit b248125 Change-Id: I05e6d003bf528ff4c445d1610b440eafc2f81ff7 --- subproc.cc | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/subproc.cc b/subproc.cc index 7792fbd..1be9ead 100644 --- a/subproc.cc +++ b/subproc.cc @@ -528,19 +528,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) { -- 2.34.1