Instead of using a array to store received signals, open a pipe and

have the signal handler write the signal number to one end and
select() on the other end.  This makes it possible to handle signals
similar to I/O without race conditions.
This commit is contained in:
Todd C. Miller
2010-09-10 11:20:32 -04:00
parent f601085de4
commit 59399d55c3
3 changed files with 239 additions and 85 deletions

View File

@@ -23,6 +23,7 @@
/* exec.c */
int my_execve(const char *path, char *const argv[], char *const envp[]);
int pipe_nonblock(int fds[2]);
/* exec_pty.c */
int fork_pty(struct command_details *details, char *argv[], char *envp[],
@@ -34,6 +35,6 @@ void handler(int s);
void pty_close(struct command_status *cstat);
void pty_setup(uid_t uid);
void terminate_child(pid_t pid, int use_pgrp);
extern sig_atomic_t recvsig[NSIG];
extern int signal_pipe[2];
#endif /* _SUDO_EXEC_H */