mirror of
https://github.com/mintycube/dwm.git
synced 2024-10-22 14:05:45 +02:00
cool autostart: restore SIGCHLD sighandler to default before spawning a program
This commit is contained in:
parent
ace6f1cd88
commit
5fefbfee64
@ -7,6 +7,7 @@ static void
|
|||||||
autostart_exec()
|
autostart_exec()
|
||||||
{
|
{
|
||||||
const char *const *p;
|
const char *const *p;
|
||||||
|
struct sigaction sa;
|
||||||
size_t i = 0;
|
size_t i = 0;
|
||||||
|
|
||||||
/* count entries */
|
/* count entries */
|
||||||
@ -17,6 +18,13 @@ autostart_exec()
|
|||||||
for (p = autostart; *p; i++, p++) {
|
for (p = autostart; *p; i++, p++) {
|
||||||
if ((autostart_pids[i] = fork()) == 0) {
|
if ((autostart_pids[i] = fork()) == 0) {
|
||||||
setsid();
|
setsid();
|
||||||
|
|
||||||
|
/* Restore SIGCHLD sighandler to default before spawning a program */
|
||||||
|
sigemptyset(&sa.sa_mask);
|
||||||
|
sa.sa_flags = 0;
|
||||||
|
sa.sa_handler = SIG_DFL;
|
||||||
|
sigaction(SIGCHLD, &sa, NULL);
|
||||||
|
|
||||||
execvp(*p, (char *const *)p);
|
execvp(*p, (char *const *)p);
|
||||||
fprintf(stderr, "dwm: execvp %s\n", *p);
|
fprintf(stderr, "dwm: execvp %s\n", *p);
|
||||||
perror(" failed");
|
perror(" failed");
|
||||||
|
Loading…
Reference in New Issue
Block a user