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:
parent
f604da453f
commit
48f1a5b4c9
@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user