]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
start: use goto instead of simple return
authorChristian Brauner <christian.brauner@ubuntu.com>
Thu, 8 Feb 2018 14:48:15 +0000 (15:48 +0100)
committerChristian Brauner <christian.brauner@ubuntu.com>
Fri, 9 Feb 2018 09:37:52 +0000 (10:37 +0100)
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/start.c

index 6987501e5a2821438fee2cb4c755439dc96bb79d..e52d8be8bf479521e7b26b54bb14c488c115a659 100644 (file)
@@ -1667,7 +1667,7 @@ static int lxc_spawn(struct lxc_handler *handler)
        /* Run any host-side start hooks */
        if (run_lxc_hooks(name, "start-host", conf, NULL)) {
                ERROR("Failed to run lxc.hook.start-host for container \"%s\".", name);
-               return -1;
+               goto out_delete_net;
        }
 
        /* Tell the child to complete its initialization and wait for it to exec
@@ -1677,7 +1677,7 @@ static int lxc_spawn(struct lxc_handler *handler)
         * value, causing us to error out).
         */
        if (lxc_sync_barrier_child(handler, LXC_SYNC_READY_START))
-               return -1;
+               goto out_delete_net;
 
        if (lxc_network_recv_name_and_ifindex_from_child(handler) < 0) {
                ERROR("Failed to receive names and ifindices for network "