]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
tools: fix variable declarations in lxc-attach
authorChristian Brauner <christian.brauner@ubuntu.com>
Tue, 24 Aug 2021 07:36:34 +0000 (09:36 +0200)
committerChristian Brauner <christian.brauner@ubuntu.com>
Tue, 24 Aug 2021 07:36:34 +0000 (09:36 +0200)
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/tools/lxc_attach.c

index bce2e1caec04d683c32e15bff330f1fd51dc496e..8cbbe1d37b1989c86bcf4d740f6c46d4a4a9dffa 100644 (file)
@@ -277,10 +277,11 @@ int main(int argc, char *argv[])
 {
        int ret = -1;
        int wexit = 0;
-       struct lxc_log log;
-       pid_t pid;
        lxc_attach_options_t attach_options = LXC_ATTACH_OPTIONS_DEFAULT;
        lxc_attach_command_t command = (lxc_attach_command_t){.program = NULL};
+       pid_t pid;
+       struct lxc_container *c;
+       struct lxc_log log;
 
        if (lxc_caps_init())
                exit(EXIT_FAILURE);
@@ -304,7 +305,7 @@ int main(int argc, char *argv[])
                        exit(EXIT_FAILURE);
                }
 
-       struct lxc_container *c = lxc_container_new(my_args.name, my_args.lxcpath[0]);
+       c = lxc_container_new(my_args.name, my_args.lxcpath[0]);
        if (!c)
                exit(EXIT_FAILURE);