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:
@@ -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 */
|
||||
|
Reference in New Issue
Block a user