summaryrefslogtreecommitdiffstats
path: root/dwm.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--dwm.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/dwm.c b/dwm.c
index 873b794..1b30cae 100644
--- a/dwm.c
+++ b/dwm.c
@@ -207,7 +207,7 @@ static void setlayout(const Arg *arg);
207static void setmfact(const Arg *arg); 207static void setmfact(const Arg *arg);
208static void setup(void); 208static void setup(void);
209static void showhide(Client *c); 209static void showhide(Client *c);
210static void sigchld(int signal); 210static void sigchld(int unused);
211static void spawn(const Arg *arg); 211static void spawn(const Arg *arg);
212static void tag(const Arg *arg); 212static void tag(const Arg *arg);
213static void tagmon(const Arg *arg); 213static void tagmon(const Arg *arg);
@@ -1428,6 +1428,10 @@ setup(void) {
1428 int w; 1428 int w;
1429 XSetWindowAttributes wa; 1429 XSetWindowAttributes wa;
1430 1430
1431 /* clean up any zombies immediately */
1432 signal(SIGCHLD, sigchld);
1433 sigchld(0);
1434
1431 /* init screen */ 1435 /* init screen */
1432 screen = DefaultScreen(dpy); 1436 screen = DefaultScreen(dpy);
1433 root = RootWindow(dpy, screen); 1437 root = RootWindow(dpy, screen);
@@ -1496,13 +1500,13 @@ showhide(Client *c) {
1496 1500
1497 1501
1498void 1502void
1499sigchld(int signal) { 1503sigchld(int unused) {
1500 while(0 < waitpid(-1, NULL, WNOHANG)); 1504 while(0 < waitpid(-1, NULL, WNOHANG));
1505 signal(SIGCHLD, sigchld);
1501} 1506}
1502 1507
1503void 1508void
1504spawn(const Arg *arg) { 1509spawn(const Arg *arg) {
1505 signal(SIGCHLD, sigchld);
1506 if(fork() == 0) { 1510 if(fork() == 0) {
1507 if(dpy) 1511 if(dpy)
1508 close(ConnectionNumber(dpy)); 1512 close(ConnectionNumber(dpy));