From 15f5d31f98565ef740c0aa70b01765c2e564501c Mon Sep 17 00:00:00 2001 From: "Devin J. Pohly" Date: Wed, 3 Mar 2021 11:29:53 -0600 Subject: [PATCH 1/2] correct key constant name Fixes #94. --- config.def.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.def.h b/config.def.h index 9384ef6..089aa37 100644 --- a/config.def.h +++ b/config.def.h @@ -68,7 +68,7 @@ static const char *menucmd[] = { "bemenu-run", NULL }; static const Key keys[] = { /* Note that Shift changes certain key codes: c -> C, 2 -> at, etc. */ /* modifier key function argument */ - { MODKEY, XKB_p, spawn, {.v = menucmd} }, + { MODKEY, XKB_KEY_p, spawn, {.v = menucmd} }, { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_Return, spawn, {.v = termcmd} }, { MODKEY, XKB_KEY_j, focusstack, {.i = +1} }, { MODKEY, XKB_KEY_k, focusstack, {.i = -1} }, From 1fa72b07728ebb396a9f236921b81c369bb12ccb Mon Sep 17 00:00:00 2001 From: "Devin J. Pohly" Date: Wed, 10 Mar 2021 09:50:09 -0600 Subject: [PATCH 2/2] remove sigchld function Explicitly setting the handler for SIGCHLD to SIG_IGN tells the OS to reap zombie processes automatically, which is what we wanted anyway. --- dwl.c | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/dwl.c b/dwl.c index 4098f86..0853f1e 100644 --- a/dwl.c +++ b/dwl.c @@ -278,7 +278,6 @@ static void setlayout(const Arg *arg); static void setmfact(const Arg *arg); static void setmon(Client *c, Monitor *m, unsigned int newtags); static void setup(void); -static void sigchld(int unused); static void spawn(const Arg *arg); static void tag(const Arg *arg); static void tagmon(const Arg *arg); @@ -1984,8 +1983,9 @@ setup(void) * clients from the Unix socket, manging Wayland globals, and so on. */ dpy = wl_display_create(); - /* clean up child processes immediately */ - sigchld(0); + /* Indicate explicitly to the OS that we are not interested in info + * about child processes (per POSIX.1-2001) */ + signal(SIGCHLD, SIG_IGN); /* The backend is a wlroots feature which abstracts the underlying input and * output hardware. The autocreate option will choose the most suitable @@ -2136,15 +2136,6 @@ setup(void) #endif } -void -sigchld(int unused) -{ - if (signal(SIGCHLD, sigchld) == SIG_ERR) - EBARF("can't install SIGCHLD handler"); - while (0 < waitpid(-1, NULL, WNOHANG)) - ; -} - void spawn(const Arg *arg) {