* B_SELECT_{READ|WRITE|ERROR} are no flags fields, so they cannot be or'ed.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37834 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2010-08-02 08:28:47 +00:00
parent bb69cd6548
commit 845a29a054
1 changed files with 8 additions and 2 deletions

View File

@ -914,15 +914,21 @@ socket_notify(net_socket* _socket, uint8 event, int32 value)
case B_SELECT_ERROR:
socket->error = value;
event |= B_SELECT_READ | B_SELECT_WRITE;
break;
}
MutexLocker _(socket->lock);
if (notify && socket->select_pool != NULL)
if (notify && socket->select_pool != NULL) {
notify_select_event_pool(socket->select_pool, event);
if (event == B_SELECT_ERROR) {
// always notify read/write on error
notify_select_event_pool(socket->select_pool, B_SELECT_READ);
notify_select_event_pool(socket->select_pool, B_SELECT_WRITE);
}
}
return B_OK;
}