mirror of
https://cagebreak.project-repo.co/cagebreak.git
synced 2026-08-23 05:54:19 +02:00
Reset signal handling when forking
This commit is contained in:
parent
fcafa33400
commit
ae0d53310c
1 changed files with 5 additions and 1 deletions
|
|
@ -628,7 +628,7 @@ keybinding_split_horizontal(struct cg_server *server) {
|
|||
|
||||
static void
|
||||
into_process(const char *command) {
|
||||
execl("/bin/sh", "sh", "-c", command, (char *)NULL);
|
||||
execlp("sh", "sh", "-c", command, (char *)NULL);
|
||||
_exit(1);
|
||||
}
|
||||
|
||||
|
|
@ -1656,6 +1656,10 @@ run_action(enum keybinding_action action, struct cg_server *server,
|
|||
case KEYBINDING_RUN_COMMAND: {
|
||||
int pid;
|
||||
if((pid = fork()) == 0) {
|
||||
setsid();
|
||||
sigset_t set;
|
||||
sigemptyset(&set);
|
||||
sigprocmask(SIG_SETMASK, &set, NULL);
|
||||
if(fork() == 0) {
|
||||
into_process(data.c);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue