summaryrefslogtreecommitdiffstats
path: root/dwm.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--dwm.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/dwm.c b/dwm.c
index 03baf42..c2bd871 100644
--- a/dwm.c
+++ b/dwm.c
@@ -205,7 +205,6 @@ static void setmfact(const Arg *arg);
205static void setup(void); 205static void setup(void);
206static void seturgent(Client *c, int urg); 206static void seturgent(Client *c, int urg);
207static void showhide(Client *c); 207static void showhide(Client *c);
208static void sigchld(int unused);
209static void spawn(const Arg *arg); 208static void spawn(const Arg *arg);
210static void tag(const Arg *arg); 209static void tag(const Arg *arg);
211static void tagmon(const Arg *arg); 210static void tagmon(const Arg *arg);
@@ -1543,9 +1542,16 @@ setup(void)
1543 int i; 1542 int i;
1544 XSetWindowAttributes wa; 1543 XSetWindowAttributes wa;
1545 Atom utf8string; 1544 Atom utf8string;
1545 struct sigaction sa;
1546 1546
1547 /* clean up any zombies immediately */ 1547 /* do not transform children into zombies when they terminate */
1548 sigchld(0); 1548 sigemptyset(&sa.sa_mask);
1549 sa.sa_flags = SA_NOCLDSTOP | SA_NOCLDWAIT | SA_RESTART;
1550 sa.sa_handler = SIG_IGN;
1551 sigaction(SIGCHLD, &sa, NULL);
1552
1553 /* clean up any zombies (inherited from .xinitrc etc) immediately */
1554 while (waitpid(-1, NULL, WNOHANG) > 0);
1549 1555
1550 /* init screen */ 1556 /* init screen */
1551 screen = DefaultScreen(dpy); 1557 screen = DefaultScreen(dpy);
@@ -1639,14 +1645,6 @@ showhide(Client *c)
1639} 1645}
1640 1646
1641void 1647void
1642sigchld(int unused)
1643{
1644 if (signal(SIGCHLD, sigchld) == SIG_ERR)
1645 die("can't install SIGCHLD handler:");
1646 while (0 < waitpid(-1, NULL, WNOHANG));
1647}
1648
1649void
1650spawn(const Arg *arg) 1648spawn(const Arg *arg)
1651{ 1649{
1652 if (arg->v == dmenucmd) 1650 if (arg->v == dmenucmd)