Got questions, comments, patches, etc.?
Contact Jason Woofenden
gitweb
/
dwm.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fixing two off-by-ones
[dwm.git]
/
util.c
diff --git
a/util.c
b/util.c
index
2eb9eb2
..
91df00b
100644
(file)
--- a/
util.c
+++ b/
util.c
@@
-51,12
+51,13
@@
spawn(Arg *arg)
if(!arg->cmd)
return;
if(!arg->cmd)
return;
+ /* the double-fork construct avoids zombie processes */
if(fork() == 0) {
if(fork() == 0) {
if(dpy)
close(ConnectionNumber(dpy));
setsid();
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");
}
fprintf(stderr, "dwm: execl '%s -c %s'", shell, arg->cmd);
perror(" failed");
}