This is the mail archive of the cygwin-patches 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: select.cc exitsock error cleanup


On 5/23/06, Christopher Faylor wrote:
I've checked in a variation of this patch but I've used si->exitsock
for consistency.

I'm sure that's wrong. With your version, the next time select() is called, the thread-local socket will still look like a valid socket, even though it has been closed and can't be used. Thus, no further select()ing may be done on sockets from that thread.

Hmm. Also, the proper error return value appears to be 0, not -1.

So try this version. (I kept si->exitsock in there for good measure --
maybe it'll help someone stepping through with a debugger one day,
etc).

2006-05-23 Lev Bishop <lev.bishop+cygwin@gmail.com>

	* select.cc (start_thread_socket): Really clean up exitsock in
	case of error. Return correct error return value.


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