Author: mmlr Date: 2010-01-19 05:31:35 +0100 (Tue, 19 Jan 2010) New Revision: 35154 Changeset: http://dev.haiku-os.org/changeset/35154/haiku Modified: haiku/trunk/src/add-ons/kernel/network/protocols/tcp/TCPEndpoint.cpp Log: anevilyak+mmlr: accept() is supposed to return B_WOULD_BLOCK when SO_NONBLOCK is set. Modified: haiku/trunk/src/add-ons/kernel/network/protocols/tcp/TCPEndpoint.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/network/protocols/tcp/TCPEndpoint.cpp 2010-01-19 03:02:11 UTC (rev 35153) +++ haiku/trunk/src/add-ons/kernel/network/protocols/tcp/TCPEndpoint.cpp 2010-01-19 04:31:35 UTC (rev 35154) @@ -673,8 +673,12 @@ status = acquire_sem_etc(fAcceptSemaphore, 1, B_ABSOLUTE_TIMEOUT | B_CAN_INTERRUPT, timeout); - if (status != B_OK) + if (status != B_OK) { + if (status == B_TIMED_OUT && socket->receive.timeout == 0) + return B_WOULD_BLOCK; + return status; + } locker.Lock(); status = gSocketModule->dequeue_connected(socket, _acceptedSocket);