diff options
author | Anselm R Garbe | 2009-08-13 10:45:59 +0100 |
---|---|---|
committer | Anselm R Garbe | 2009-08-13 10:45:59 +0100 |
commit | 0ab477bf7cd234008f54f4b80fede70aa9098d15 (patch) | |
tree | 8875aa192175e34a3aeb63a83710a046963bcdca /dwm.c | |
parent | 3802172f9a990d62adee91e644d4f701dfbb5160 (diff) | |
download | aur-0ab477bf7cd234008f54f4b80fede70aa9098d15.tar.gz |
added merged patch of anydot and Neale
Diffstat (limited to 'dwm.c')
-rw-r--r-- | dwm.c | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -207,7 +207,7 @@ static void setlayout(const Arg *arg); static void setmfact(const Arg *arg); static void setup(void); static void showhide(Client *c); -static void sigchld(int signal); +static void sigchld(int unused); static void spawn(const Arg *arg); static void tag(const Arg *arg); static void tagmon(const Arg *arg); @@ -1428,6 +1428,10 @@ setup(void) { int w; XSetWindowAttributes wa; + /* clean up any zombies immediately */ + signal(SIGCHLD, sigchld); + sigchld(0); + /* init screen */ screen = DefaultScreen(dpy); root = RootWindow(dpy, screen); @@ -1496,13 +1500,13 @@ showhide(Client *c) { void -sigchld(int signal) { +sigchld(int unused) { while(0 < waitpid(-1, NULL, WNOHANG)); + signal(SIGCHLD, sigchld); } void spawn(const Arg *arg) { - signal(SIGCHLD, sigchld); if(fork() == 0) { if(dpy) close(ConnectionNumber(dpy)); |