]> git.proxmox.com Git - mirror_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>
Fri, 16 Feb 2018 22:18:54 +0000 (23:18 +0100)
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/start.c

index b90d5ea00a063a1f435e15a2e4863e225efcf0fd..a64f6b64c47dfc3b51141200dd94bbff90e96f78 100644 (file)
@@ -628,7 +628,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)