Voila, one single line of change make dmenu_extended_run launch again!

    git diff dwm.c 
    diff --git a/dwm.c b/dwm.c
    index c2bd871..f8f83f8 100644
    --- a/dwm.c
    +++ b/dwm.c
    @@ -1653,6 +1653,7 @@ spawn(const Arg *arg)
                    if (dpy)
                            close(ConnectionNumber(dpy));
                    setsid();
    +               signal(SIGCHLD, SIG_DFL);
                    execvp(((char **)arg->v)[0], (char **)arg->v);
                    die("dwm: execvp '%s' failed:", ((char **)arg->v)[0]);

On 08.04.23 23:02, Storkman wrote:
> On Sat, Apr 08, 2023 at 04:28:15PM +0200, p...@mailbox.org wrote:
> > Hello everyone,
> > 
> > I bind keyboard shortcut to launch dmenu_extended[1] in dwm, what works
> > flawlessly before the `Use sigaction(SA_NOCLDWAIT) for SIGCHLD
> > handling` [1] commit, since dmenu_extended does not change anything here,
> > is this a regression or bug introduced with this commit or
> > dmenu_extended need to adapt to conform the change? thanks.
> 
> From sigaction(2):
> > A child created via fork(2) inherits a copy of its parent's signal 
> > dispositions.
> > During an execve(2), the dispositions of handled signals are reset to the 
> > default;
> > the dispositions of ignored signals are left unchanged.
> 
> This would explain why running programs affected by this through st works,
> since it runs "signal(SIGCHLD, SIG_DFL)" before executing the shell 
> (st.c:715).
> 
> Adding "signal(SIGCHLD, SIG_DFL)" before execvp in spawn() at dwm.c:1657 fixes
> anki and mpv with youtube-dl for me.
> 
> > 
> > [1] https://github.com/MarkHedleyJones/dmenu-extended/
> > [2] 
> > https://git.suckless.org/dwm/commit/712d6639ff8e863560328131bbb92b248dc9cde7.html
> > 
> 

Reply via email to