On Thu, Oct 06, 2011 at 08:29:19PM +0200, Marco Atzeri wrote: >On 10/4/2011 6:39 PM, Christopher Faylor wrote: > >> As I mentioned in the thread, that is supposed to be implemented in >> Cygwin. I could never see a case where it wasn't sent. >> >> cgf > >Hi Cgf, >my understanding of your explanation: > >"Sort of. If the process is doing a read, it is supposed to detect that >the tty has been closed and a SIGHUP is supposed to be sent. It is not >precisely the same thing as sending a SIGHUP when the master closes but >I'm surprised that, in principle, it doesn't amount to the same thing. > >Just see any of the SIGHUPs in fhandler_tty.cc. They are all supposed >to be dealing with this scenario. > >So, unless bash is not waiting for input (which is unlikely) this should >work." > >was : >- it is not implemented >- you see no pratical case were this could be a problem as > the program waiting for data should recognize the closure > and correctly handling it > >Checking fhandler_tty.cc , I see no implementation, but I can be wrong >as my understanding of cygwin internals is limited. > >I admit that mc expectation is a corner case, but the subshell closure >was based on such assumption (src/subshell.c) > >/* Close master side of pty. This is important; apart from */ >/* freeing up the descriptor for use in the subshell, it also */ >/* means that when MC exits, the subshell will get a SIGHUP and */ >/* exit too, because there will be no more descriptors pointing */ >/* at the master side of the pty and so it will disappear. */ > >so as workaround I added a SIGHUP > > kill (subshell_pid, SIGHUP); > >just before mc exit on the main, to simulate the behaviour >and the subshell closes as needed. > >Linux and BSD correctly handle the situation while only cygwin >was reported missing this behaviour.
I was being imprecise in my response. I understand what you say you did. There was no reason to reexplain. Once again, I don't understand why Cygwin's current implementation is inadequate to handle the problem that you are seeing. You can assert that it must be because Cygwin does not explicitly send a SIGHUP on close and you may be right but, again, I don't see why the current implementation, which should amount to the same thing, does not work. Yes. It isn't explicitly implemented but it shouldn't matter. cgf -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple