As Ingo pointed out correctly, B_INTERRUPTED is never returned when a semaphore

goes away; therefore we must not return B_BAD_PORT_ID in this case.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11305 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2005-02-10 01:08:55 +00:00
parent c3b0c1efca
commit f4a87ad575
+5 -5
View File
@@ -781,7 +781,7 @@ port_buffer_size_etc(port_id id, uint32 flags, bigtime_t timeout)
// block if no message, or, if B_TIMEOUT flag set, block with timeout
status = acquire_sem_etc(cachedSem, 1, flags, timeout);
if (status == B_BAD_SEM_ID || status == B_INTERRUPTED) {
if (status == B_BAD_SEM_ID) {
// somebody deleted the port
return B_BAD_PORT_ID;
}
@@ -900,8 +900,8 @@ read_port_etc(port_id id, int32 *_msgCode, void *msgBuffer, size_t bufferSize,
status = acquire_sem_etc(cachedSem, 1, flags, timeout);
// get 1 entry from the queue, block if needed
if (status == B_BAD_SEM_ID || status == B_INTERRUPTED) {
/* somebody deleted the port or the sem went away */
if (status == B_BAD_SEM_ID) {
// somebody deleted the port
return B_BAD_PORT_ID;
}
if (status != B_OK)
@@ -1012,8 +1012,8 @@ write_port_etc(port_id id, int32 msgCode, const void *msgBuffer,
status = acquire_sem_etc(cachedSem, 1, flags, timeout);
// get 1 entry from the queue, block if needed
if (status == B_BAD_SEM_ID || status == B_INTERRUPTED) {
// somebody deleted the port or the sem while we were waiting
if (status == B_BAD_SEM_ID) {
// somebody deleted the port
return B_BAD_PORT_ID;
}
if (status != B_OK)