]> git.proxmox.com Git - mirror_lxc.git/commitdiff
attach: s/close/close_prot_errno_disarm/g
authorChristian Brauner <christian.brauner@ubuntu.com>
Fri, 29 Jan 2021 12:10:14 +0000 (13:10 +0100)
committerChristian Brauner <christian.brauner@ubuntu.com>
Fri, 29 Jan 2021 12:11:24 +0000 (13:11 +0100)
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/attach.c

index a8cfe360b68fecf3b6ab63e44390b03c4c6efd73..adc9b4088043d803329184c174f6619b0fc1caf8 100644 (file)
@@ -864,7 +864,7 @@ __noreturn static void do_attach(struct attach_clone_payload *payload)
                        lsm_label = ctx->lsm_label;
                ret = ctx->lsm_ops->process_label_set_at(ctx->lsm_ops, lsm_fd,
                                                        lsm_label, on_exec);
-               close(lsm_fd);
+               close_prot_errno_disarm(lsm_fd);
                if (ret < 0)
                        goto on_error;
 
@@ -1279,7 +1279,7 @@ int lxc_attach(struct lxc_container *container, lxc_attach_exec_t exec_function,
        to_cleanup_pid = pid;
 
        /* close unneeded file descriptors */
-       close(ipc_sockets[1]);
+       close_prot_errno_disarm(ipc_sockets[1]);
        close_nsfds(ctx);
        if (options->attach_flags & LXC_ATTACH_TERMINAL)
                lxc_attach_terminal_close_pts(&terminal);
@@ -1406,8 +1406,7 @@ int lxc_attach(struct lxc_container *container, lxc_attach_exec_t exec_function,
 
        /* Now shut down communication with child, we're done. */
        shutdown(ipc_sockets[0], SHUT_RDWR);
-       close(ipc_sockets[0]);
-       ipc_sockets[0] = -1;
+       close_prot_errno_disarm(ipc_sockets[0]);
 
        ret_parent = 0;
        to_cleanup_pid = -1;
@@ -1427,7 +1426,7 @@ close_mainloop:
 on_error:
        if (ipc_sockets[0] >= 0) {
                shutdown(ipc_sockets[0], SHUT_RDWR);
-               close(ipc_sockets[0]);
+               close_prot_errno_disarm(ipc_sockets[0]);
        }
 
        if (to_cleanup_pid > 0)