}
static void
-pty_close(struct sudo_event_base *evbase, struct command_status *cstat)
+pty_close(struct command_status *cstat)
{
struct io_buffer *iob;
int n;
debug_decl(pty_close, SUDO_DEBUG_EXEC);
/* Close the pty slave first so reads from the master don't block. */
- if (io_fds[SFD_SLAVE] != -1) {
- ev_free_by_fd(evbase, io_fds[SFD_SLAVE]);
- close(io_fds[SFD_SLAVE]);
- io_fds[SFD_SLAVE] = -1;
- }
+ close(io_fds[SFD_SLAVE]);
/* Flush any remaining output (the plugin already got it). */
if (io_fds[SFD_USERTTY] != -1) {
utmp_logout(slavename, cstat->type == CMD_WSTATUS ? cstat->val : 0);
/* Close pty master. */
- if (io_fds[SFD_MASTER] != -1)
- close(io_fds[SFD_MASTER]);
+ close(io_fds[SFD_MASTER]);
debug_return;
}
}
/* Flush any remaining output, free I/O bufs and events, do logout. */
- pty_close(ec.evbase, cstat);
+ pty_close(cstat);
/* Free things up. */
free_exec_closure_pty(&ec);