X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=util.c;h=91df00b17e6461d0fa7cda22f5c33e62bb253d2f;hb=a50b15a9e9663b1a7ee11d39ddf246427aecaeef;hp=2eb9eb2420ccec6ae1b5e2da1649b960e588ee91;hpb=6a3ae5e26a5cebfd35f2423aec0c47843b5a85be;p=dwm.git diff --git a/util.c b/util.c index 2eb9eb2..91df00b 100644 --- a/util.c +++ b/util.c @@ -51,12 +51,13 @@ spawn(Arg *arg) if(!arg->cmd) return; + /* the double-fork construct avoids zombie processes */ if(fork() == 0) { if(fork() == 0) { if(dpy) close(ConnectionNumber(dpy)); setsid(); - execl(shell, shell, "-c", arg->cmd, NULL); + execl(shell, shell, "-c", arg->cmd, (char *)NULL); fprintf(stderr, "dwm: execl '%s -c %s'", shell, arg->cmd); perror(" failed"); }