modified to allow handling of messages without data

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16630 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Marcus Overhagen 2006-03-07 14:47:45 +00:00
parent 3bb81a4239
commit 9b9d1e82f4

View File

@ -358,12 +358,12 @@ BMediaNode::WaitForMessage(bigtime_t waitUntil,
ssize_t size;
size = read_port_etc(ControlPort(), &message, data, sizeof(data), B_ABSOLUTE_TIMEOUT, waitUntil);
if (size <= 0) {
if (size == 0 && message == 0)
return B_OK; // a null message was received (to unblock the read)
if (size < 0) {
if (size != B_TIMED_OUT)
ERROR("BMediaNode::WaitForMessage: read_port_etc error 0x%08lx\n",size);
return size; // returns the error code
return size; // return the error code
} else if (size == 0 && message == 0) {
return B_OK; // a null message was received (to unblock the read)
}
PRINT(7, "BMediaNode::WaitForMessage %#lx, node %ld, this %p\n", message, fNodeID, this);