<div dir="ltr">Actually, I misspoke (and so did the commit message) -- we aren't closing stdin, but rather redirecting it to /dev/null.<br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Jan 12, 2021 at 10:13 AM Brandon Allbery <<a href="mailto:allbery.b@gmail.com">allbery.b@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="auto">Probably we should not be closing it; or at least should have it open on /dev/null. There is a general expectation in the POSIX model that fds 0, 1, 2 are open.</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Jan 12, 2021, 10:06 ivan <<a href="mailto:ivan.brennan@gmail.com" target="_blank">ivan.brennan@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">In 'spawn', we close stdin in the child process, whereas in 'safeSpawn' from xmonad-contrib we do not. I'm curious why that's the case?<div><br></div><div>This commit introduced the code that closes stdin, but doesn't describe the motivation for doing so:</div><div><a href="https://github.com/xmonad/xmonad/commit/353e7cd6811245fbee7c8c6cf821041c924523b3" rel="noreferrer" target="_blank">https://github.com/xmonad/xmonad/commit/353e7cd6811245fbee7c8c6cf821041c924523b3</a></div><div><br></div><div>I suspect we close stdin in 'spawn' because we know it won't be needed, but I'm still not sure what we gain by closing it (does it improve efficiency?). And should we be closing it in 'safeSpawn' as well, or does 'safeSpawn' have a use-case that requires reading from stdin?</div></div>
_______________________________________________<br>
xmonad mailing list<br>
<a href="mailto:xmonad@haskell.org" rel="noreferrer" target="_blank">xmonad@haskell.org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/xmonad" rel="noreferrer noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/xmonad</a><br>
</blockquote></div>
</blockquote></div>