From: ndrewh Date: Thu, 4 Nov 2021 01:17:18 +0000 (-0400) Subject: Fix compile using `FROM ubuntu:20.04` X-Git-Tag: accepted/tizen/unified/20230621.023214^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7d9ba636a886b4be166c9a8d0615635e27b8d937;p=platform%2Fupstream%2Fnsjail.git 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 --- 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) {