Patch by Eric Petit: A read select() should not block when there's not data

available anymore and the remote end has been write-shut-down. Fixes #3536.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30846 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold 2009-05-24 22:13:12 +00:00
parent f604da453f
commit 48f1a5b4c9

View File

@ -633,7 +633,10 @@ UnixEndpoint::Receivable()
RETURN_ERROR(ENOTCONN);
UnixFifoLocker fifoLocker(fReceiveFifo);
RETURN_ERROR(fReceiveFifo->Readable());
ssize_t readable = fReceiveFifo->Readable();
if (readable == 0 && fReceiveFifo->IsWriteShutdown())
RETURN_ERROR(ENOTCONN);
RETURN_ERROR(readable);
}