This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: cygwin-2 process handling


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 <corinna-cygwin@cygwin.com> 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 <takashi.yano@nifty.ne.jp>

Attachment: cygwin.patch.20150528
Description: Binary data

--
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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]