
4 Jun
2007
4 Jun
'07
2:03 p.m.
Tomasz Zielonka wrote:
So the question is: shouldn't runInteractiveCommand / runInteractiveProcess close descriptors greater then 2 in the child process?
No. What your colleague experienced is normal Unix behaviour with about 30 years of history under its belt. Having Haskell do something different would be the surprise here. You can mark file descriptors that you don't want shared with fcntl's F_SETFD command, and FD_CLOEXEC: noExec :: Handle -> IO () noExec h = do fd <- handleToFd h setFdOption fd CloseOnExec True