]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
attach: order variables correctly
authorChristian Brauner <christian.brauner@ubuntu.com>
Thu, 28 Jan 2021 16:53:44 +0000 (17:53 +0100)
committerChristian Brauner <christian.brauner@ubuntu.com>
Thu, 28 Jan 2021 16:53:44 +0000 (17:53 +0100)
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/attach.c

index b45c634192d0bc9cb9c398e0b2d34ba62e8bfff5..1d08362ff193a32e82f2b71f293657572fc47fb0 100644 (file)
@@ -952,19 +952,17 @@ int lxc_attach(struct lxc_container *container, lxc_attach_exec_t exec_function,
               pid_t *attached_process)
 {
        __do_free char *cwd = NULL;
+       int ret_parent = -1;
+       struct attach_clone_payload payload = {};
+       struct lxc_epoll_descr descr = {};
        int i, ret, status;
+       char *name, *lxcpath, *new_cwd;
        int ipc_sockets[2];
-       char *new_cwd;
        signed long personality;
-       pid_t attached_pid, init_pid, pid;
+       pid_t attached_pid, init_pid, pid, to_cleanup_pid;
        struct lxc_proc_context_info *init_ctx;
        struct lxc_terminal terminal;
        struct lxc_conf *conf;
-       char *name, *lxcpath;
-       struct attach_clone_payload payload = {0};
-       int ret_parent = -1;
-       pid_t to_cleanup_pid;
-       struct lxc_epoll_descr descr = {0};
 
        ret = access("/proc/self/ns", X_OK);
        if (ret)