]> git.proxmox.com Git - mirror_lxcfs.git/commitdiff
cgroup_fuse: s/clone/lxcfs_clone/g
authorChristian Brauner <christian.brauner@ubuntu.com>
Thu, 16 Apr 2020 15:34:42 +0000 (17:34 +0200)
committerStéphane Graber <stgraber@ubuntu.com>
Thu, 16 Apr 2020 19:56:05 +0000 (15:56 -0400)
Fixes: Coverity 355713.
Fixes: Coverity 355723.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/bindings.c
src/bindings.h
src/cgroup_fuse.c

index 81bebdc6efae25da6dec8a661807748f5f0810d5..18f47c5c2f58ab67d09675be38d6cf61e3d4a184 100644 (file)
@@ -337,7 +337,7 @@ static int send_creds_clone_wrapper(void *arg)
  * stack sizes: 8MB.
  */
 #define __LXCFS_STACK_SIZE (8 * 1024 * 1024)
-static pid_t lxcfs_clone(int (*fn)(void *), void *arg, int flags)
+pid_t lxcfs_clone(int (*fn)(void *), void *arg, int flags)
 {
        pid_t ret;
        void *stack;
index ee693af32e283e548b0d0df71db4a35aaaf4cadf..28543dc064e7e4f451e7eeb569b073dbb20ece08 100644 (file)
@@ -103,4 +103,6 @@ static inline int install_signal_handler(int signo,
        return sigaction(signo, &action, NULL);
 }
 
+extern pid_t lxcfs_clone(int (*fn)(void *), void *arg, int flags);
+
 #endif /* __LXCFS_BINDINGS_H */
index d090873bec50062e9848399136e1dc9f57ab2ea2..2d37a59a411f3ac8f5ed5416337c9112248e9c16 100644 (file)
@@ -1223,10 +1223,8 @@ static void pid_to_ns_wrapper(int sock, pid_t tpid)
                .tpid = tpid,
                .wrapped = &pid_to_ns
        };
-       size_t stack_size = sysconf(_SC_PAGESIZE);
-       void *stack = alloca(stack_size);
 
-       cpid = clone(pid_ns_clone_wrapper, stack + stack_size, SIGCHLD, &args);
+       cpid = lxcfs_clone(pid_ns_clone_wrapper, &args, 0);
        if (cpid < 0)
                _exit(1);
 
@@ -1562,10 +1560,8 @@ static void pid_from_ns_wrapper(int sock, pid_t tpid)
                .tpid = tpid,
                .wrapped = &pid_from_ns
        };
-       size_t stack_size = sysconf(_SC_PAGESIZE);
-       void *stack = alloca(stack_size);
 
-       cpid = clone(pid_ns_clone_wrapper, stack + stack_size, SIGCHLD, &args);
+       cpid = lxcfs_clone(pid_ns_clone_wrapper, &args, 0);
        if (cpid < 0)
                _exit(1);