diff options
Diffstat (limited to 'dwm.c')
| -rw-r--r-- | dwm.c | 20 |
1 files changed, 9 insertions, 11 deletions
| @@ -205,7 +205,6 @@ static void setmfact(const Arg *arg); | |||
| 205 | static void setup(void); | 205 | static void setup(void); |
| 206 | static void seturgent(Client *c, int urg); | 206 | static void seturgent(Client *c, int urg); |
| 207 | static void showhide(Client *c); | 207 | static void showhide(Client *c); |
| 208 | static void sigchld(int unused); | ||
| 209 | static void spawn(const Arg *arg); | 208 | static void spawn(const Arg *arg); |
| 210 | static void tag(const Arg *arg); | 209 | static void tag(const Arg *arg); |
| 211 | static void tagmon(const Arg *arg); | 210 | static void tagmon(const Arg *arg); |
| @@ -1543,9 +1542,16 @@ setup(void) | |||
| 1543 | int i; | 1542 | int i; |
| 1544 | XSetWindowAttributes wa; | 1543 | XSetWindowAttributes wa; |
| 1545 | Atom utf8string; | 1544 | Atom utf8string; |
| 1545 | struct sigaction sa; | ||
| 1546 | 1546 | ||
| 1547 | /* clean up any zombies immediately */ | 1547 | /* do not transform children into zombies when they terminate */ |
| 1548 | sigchld(0); | 1548 | sigemptyset(&sa.sa_mask); |
| 1549 | sa.sa_flags = SA_NOCLDSTOP | SA_NOCLDWAIT | SA_RESTART; | ||
| 1550 | sa.sa_handler = SIG_IGN; | ||
| 1551 | sigaction(SIGCHLD, &sa, NULL); | ||
| 1552 | |||
| 1553 | /* clean up any zombies (inherited from .xinitrc etc) immediately */ | ||
| 1554 | while (waitpid(-1, NULL, WNOHANG) > 0); | ||
| 1549 | 1555 | ||
| 1550 | /* init screen */ | 1556 | /* init screen */ |
| 1551 | screen = DefaultScreen(dpy); | 1557 | screen = DefaultScreen(dpy); |
| @@ -1639,14 +1645,6 @@ showhide(Client *c) | |||
| 1639 | } | 1645 | } |
| 1640 | 1646 | ||
| 1641 | void | 1647 | void |
| 1642 | sigchld(int unused) | ||
| 1643 | { | ||
| 1644 | if (signal(SIGCHLD, sigchld) == SIG_ERR) | ||
| 1645 | die("can't install SIGCHLD handler:"); | ||
| 1646 | while (0 < waitpid(-1, NULL, WNOHANG)); | ||
| 1647 | } | ||
| 1648 | |||
| 1649 | void | ||
| 1650 | spawn(const Arg *arg) | 1648 | spawn(const Arg *arg) |
| 1651 | { | 1649 | { |
| 1652 | if (arg->v == dmenucmd) | 1650 | if (arg->v == dmenucmd) |
