djpohly / dwl

dwm for Wayland - ARCHIVE: development has moved to Codeberg
https://codeberg.org/dwl/dwl
Other
1.94k stars 283 forks source link

fix startup_cmd SIGCHLD handler #434

Closed djpohly closed 1 year ago

djpohly commented 1 year ago

Looks like ignored signals aren't reset by exec() calls. If the startup command needs to fork and wait on child processes (e.g. a session manager like s6-svscan), the SIG_IGN that is still in place will interfere with waiting.

sevz17 commented 1 year ago

Looks like ignored signals aren't reset by exec() calls.

So we could do this for spawn() too, right?

djpohly commented 1 year ago

Good call. If it makes the code simpler/easier to understand, I guess we could forgo the SIG_IGN altogether and just set a handler, which would then be reset by exec.

sevz17 commented 1 year ago

How many lines would it add?

I am a bit reluctant to add more lines, in wlroots-next there are already 2230 lines.

sevz17 commented 1 year ago

We could also entirely give up in the SLOC limit and try to make the code more readable/correct, but still trying to do things in the simplest way.

I am only concerned about SLOC because it's one of the principles of dwl, but I would not mind if we remove the limit.

djpohly commented 1 year ago

Oh, I'll watch my SLOC footprint for sure! I had a hunch the suggestion would actually reduce lines, and it turns out it did. This PR now reduces the count from cloc dwl.c by 5.

sevz17 commented 1 year ago

Thank you!