commit - 91fffb3f7d0cd731aa2a2126c411590d30231c19
commit + 33fe200b521b19a089d39aca247bb78432e02e6d
blob - 873b7944487b4e14d28ad8c76cb98cab35fa2a08
blob + 1b30cae1b02dc1f5d58366267e4979092b7fb23b
--- dwm.c
+++ dwm.c
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);
int w;
XSetWindowAttributes wa;
+ /* clean up any zombies immediately */
+ signal(SIGCHLD, sigchld);
+ sigchld(0);
+
/* init screen */
screen = DefaultScreen(dpy);
root = RootWindow(dpy, screen);
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));