]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
start: don't call close on invalid file descriptor
authorChristian Brauner <christian.brauner@ubuntu.com>
Fri, 16 Feb 2018 22:18:54 +0000 (23:18 +0100)
committerChristian Brauner <christian.brauner@ubuntu.com>
Sat, 17 Feb 2018 12:49:57 +0000 (13:49 +0100)
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/start.c

index 473b8b99b80e303f71a093ffe8a77e62ae78beb3..fb11688bd037c997ca4cd9bc4794c93e915b06e9 100644 (file)
@@ -630,7 +630,7 @@ void lxc_free_handler(struct lxc_handler *handler)
        lxc_put_nsfds(handler);
 
        if (handler->conf && handler->conf->reboot == 0)
-               if (handler->conf->maincmd_fd)
+               if (handler->conf->maincmd_fd >= 0)
                        close(handler->conf->maincmd_fd);
 
        if (handler->state_socket_pair[0] >= 0)