read_port_etc():
* Also check whether the port is closed after waiting. * Don't increment read_count after waiting failed. That should have been the cause of #5119. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34687 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -1175,7 +1175,8 @@ read_port_etc(port_id id, int32* _code, void* buffer, size_t bufferSize,
|
|||||||
|
|
||||||
locker.Lock();
|
locker.Lock();
|
||||||
|
|
||||||
if (sPorts[slot].id != id) {
|
if (sPorts[slot].id != id
|
||||||
|
|| (is_port_closed(slot) && sPorts[slot].messages.IsEmpty())) {
|
||||||
// the port is no longer there
|
// the port is no longer there
|
||||||
T(Read(sPorts[slot], 0, B_BAD_PORT_ID));
|
T(Read(sPorts[slot], 0, B_BAD_PORT_ID));
|
||||||
return B_BAD_PORT_ID;
|
return B_BAD_PORT_ID;
|
||||||
@@ -1183,7 +1184,6 @@ read_port_etc(port_id id, int32* _code, void* buffer, size_t bufferSize,
|
|||||||
|
|
||||||
if (status != B_OK) {
|
if (status != B_OK) {
|
||||||
T(Read(sPorts[slot], 0, status));
|
T(Read(sPorts[slot], 0, status));
|
||||||
sPorts[slot].read_count++;
|
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user