]> git.ipfire.org Git - pakfire.git/commitdiff
execute: Check for CLONE_INTO_CGROUP at compile time
authorMichael Tremer <michael.tremer@ipfire.org>
Sun, 11 Jul 2021 13:40:32 +0000 (14:40 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Sun, 11 Jul 2021 13:40:32 +0000 (14:40 +0100)
This allows building Pakfire with older kernels, but causes that
processes are not forked into the correct cgroup.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/libpakfire/execute.c

index 93b6c78aa8e89e96fae21c98fb1cde6dfc3d40a5..307e98f7b988732d9a3c64d7a879ecd553c4a5fe 100644 (file)
@@ -571,8 +571,10 @@ PAKFIRE_EXPORT int pakfire_execute(struct pakfire* pakfire, const char* argv[],
                goto ERROR;
        }
 
+#ifdef CLONE_INTO_CGROUP
        args.flags |= CLONE_INTO_CGROUP;
        args.cgroup = dirfd(cgroupdir);
+#endif
 
        // Fork this process
        pid_t pid = syscall(__NR_clone3, &args, sizeof(args));