Hi Corinna, On Wed, 27 May 2015 14:23:12 +0200 Corinna Vinschen wrote: > Isn't that racy? Consider two processes doing that at the same time. > Both calls to NtQueryObject could come up with hdl_cnt == 2 and the > problem persists. Yes, indeed. I didn't consider enough. > Wouldn't it be safer to call SetEvent(input_available_event) all the > time from here? On Wed, 27 May 2015 17:17:34 +0200 Corinna Vinschen wrote: > We discussed this already in March and only briefly talked about a > change like this requiring changes to fhandler_pty_slave::read. > However, I don't see this. The read code already takes 0 bytes input > and broken pipe scenarios into account. Do you see something needing > a change I don't? Just calling SetEvent(input_available_event) at all time in fhandler_pty_master::close() causes immediate closure of the shell on pty at the start. Some modifications in fhandler_pty_slave::read() seems necessary. I have made a patch attached, which modifies fhandler_pty_slave:: read() as well. I have not confirmed enough yet, but it seems to work for me. Please have a look. -- Takashi Yano