[xmonad] Why do we close stdin in (some) spawned processes?

Tomas Janousek tomi at nomi.cz
Tue Jan 12 22:51:19 UTC 2021


On Tue, Jan 12, 2021 at 05:29:15PM -0500, ivan wrote:
>Thanks for the explanation, that makes sense. I looked at the history of
>'safeSpawn' and interestingly, it used to call xfork, but that was changed
>in this commit:
>https://github.com/xmonad/xmonad-contrib/commit/1844c80978844611f7d409cab7c313bb0c0649bf

That commit makes no sense. xfork always did uninstallSignalHandlers. 
Actually, xfork is still exactly the same function it was in 2009 when 
it appeared for the first time.

The only exaplanation I have is that the reporter of 
https://code.google.com/archive/p/xmonad/issues/441 used xmonad-contrib 
that didn't use xfork yet (that is, before 
https://github.com/xmonad/xmonad-contrib/commit/e8c0f39fd5238771d14b920b8b87f89e7b56c30f), 
and reported an issue which gwern tried to fix without knowing it'd 
already been fixed but the reporter isn't running the fix yet, and 
pushed yet another fix (1844c8097 that you mentioned) but forgot about 
stdin. This explanation assumes the problem was in signal handling, but 
the discussion in https://code.google.com/archive/p/xmonad/issues/441 
looks like it was, indeed.

So I think 1844c8097 can just be reverted, the issue was most probably 
already fixed by e8c0f39fd5.

>The issue described in that commit, though, seems to be related to signal
>handlers rather than stdin (though it also sounds like the exact issue may
>not have been identified).

-- 
Tomáš Janoušek, a.k.a. Pivník, a.k.a. Liskni_si, https://work.lisk.in/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/xmonad/attachments/20210112/640b47be/attachment.html>


More information about the xmonad mailing list