From f4a87ad57577fb32d371bec3812e26728866914b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Thu, 10 Feb 2005 01:08:55 +0000 Subject: [PATCH] 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 --- src/kernel/core/port.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/kernel/core/port.c b/src/kernel/core/port.c index 3e944ad6af..7abccf050e 100644 --- a/src/kernel/core/port.c +++ b/src/kernel/core/port.c @@ -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)