This is the mail archive of the 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: [PATCH] to_slave pipe is full fix

On Mon, Dec 16, 2002 at 10:51:14PM -0500, Christopher Faylor wrote:
> One more question, though.  In accept_input, shouldn't ret be set to
> something besides 1 when there is an "error writing to pipe"?

True.  I hadn't been considering the error case. 
I've attached a patch for this.  It's not terribly pretty. 

> I wonder if there is some other way to do this other than pulling
> everything out of the read ahead buffer and then putting it back on
> failure.  I guess it doesn't matter since this is an edge condition.

There's some things that could be done such as moving the get_readahead
later, but I agree, no point in adding complexity for this case. 

> Hmm.  I wonder if the WaitForSingleObject (input_mutex,...) is enough to
> make this code thread safe. 

I think so, but it may be more protection than you need.  OTOH, the
readahead buffer could probably use some more protection on the filling


Attachment: tty5.patch
Description: Text document

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