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;
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);
/* 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;
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)