]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
start: use lxc_raw_clone_cb() where possible
authorChristian Brauner <christian.brauner@ubuntu.com>
Fri, 15 Dec 2017 16:42:31 +0000 (17:42 +0100)
committerChristian Brauner <christian.brauner@ubuntu.com>
Thu, 21 Dec 2017 22:01:04 +0000 (23:01 +0100)
This way we can rely on the kernel's copy-on-write support similar to fork().

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/start.c

index 2d3f4ed4af0db839a82fcbbcc165a600bb8fe91c..5327e44b25f283deefcc0db05b859cfe38c66dd8 100644 (file)
@@ -1284,7 +1284,7 @@ static inline int do_share_ns(void *arg)
 
        flags = handler->on_clone_flags;
        flags |= CLONE_PARENT;
-       handler->pid = lxc_clone(do_start, handler, flags);
+       handler->pid = lxc_raw_clone_cb(do_start, handler, flags);
        if (handler->pid < 0)
                return -1;
 
@@ -1414,7 +1414,7 @@ static int lxc_spawn(struct lxc_handler *handler)
                        goto out_delete_net;
                }
        } else {
-               handler->pid = lxc_clone(do_start, handler, handler->on_clone_flags);
+               handler->pid = lxc_raw_clone_cb(do_start, handler, handler->on_clone_flags);
        }
        if (handler->pid < 0) {
                SYSERROR(LXC_CLONE_ERROR);