added merged patch of anydot and Neale
33fe200b
1 file(s) · +7 −3
| 207 | 207 | static void setmfact(const Arg *arg); |
|
| 208 | 208 | static void setup(void); |
|
| 209 | 209 | static void showhide(Client *c); |
|
| 210 | - | static void sigchld(int signal); |
|
| 210 | + | static void sigchld(int unused); |
|
| 211 | 211 | static void spawn(const Arg *arg); |
|
| 212 | 212 | static void tag(const Arg *arg); |
|
| 213 | 213 | static void tagmon(const Arg *arg); |
|
| 1428 | 1428 | int w; |
|
| 1429 | 1429 | XSetWindowAttributes wa; |
|
| 1430 | 1430 | ||
| 1431 | + | /* clean up any zombies immediately */ |
|
| 1432 | + | signal(SIGCHLD, sigchld); |
|
| 1433 | + | sigchld(0); |
|
| 1434 | + | ||
| 1431 | 1435 | /* init screen */ |
|
| 1432 | 1436 | screen = DefaultScreen(dpy); |
|
| 1433 | 1437 | root = RootWindow(dpy, screen); |
|
| 1496 | 1500 | ||
| 1497 | 1501 | ||
| 1498 | 1502 | void |
|
| 1499 | - | sigchld(int signal) { |
|
| 1503 | + | sigchld(int unused) { |
|
| 1500 | 1504 | while(0 < waitpid(-1, NULL, WNOHANG)); |
|
| 1505 | + | signal(SIGCHLD, sigchld); |
|
| 1501 | 1506 | } |
|
| 1502 | 1507 | ||
| 1503 | 1508 | void |
|
| 1504 | 1509 | spawn(const Arg *arg) { |
|
| 1505 | - | signal(SIGCHLD, sigchld); |
|
| 1506 | 1510 | if(fork() == 0) { |
|
| 1507 | 1511 | if(dpy) |
|
| 1508 | 1512 | close(ConnectionNumber(dpy)); |
|