* Fix cast in user_memcpy

* Fix comparison

send and receive simple message seems to work now.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27331 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Salvatore Benedetto 2008-09-04 22:14:59 +00:00
parent 1bdc2a5203
commit b6cd7771e7

View File

@ -62,7 +62,7 @@ struct queued_message : DoublyLinkedListLinkImpl<queued_message> {
return;
if (user_memcpy(&type, _message, sizeof(long)) != B_OK
|| user_memcpy(message, (void *)((long *)_message + sizeof(long)),
|| user_memcpy(message, (void *)((char *)_message + sizeof(long)),
_length) != B_OK) {
free(message);
return;
@ -79,7 +79,7 @@ struct queued_message : DoublyLinkedListLinkImpl<queued_message> {
status_t copy_to_user_buffer(void *_message, ssize_t _length)
{
if (user_memcpy(_message, &type, sizeof(long)) != B_OK
|| user_memcpy((void *)((long *)_message + sizeof(long)), message,
|| user_memcpy((void *)((char *)_message + sizeof(long)), message,
_length) != B_OK)
return B_ERROR;
return B_OK;
@ -376,7 +376,7 @@ XsiMessageQueue::Insert(queued_message *message)
MutexLocker _(sXsiMessageCountLock);
if (fBytesInQueue == fMessageQueue.msg_qbytes
|| fBytesInQueue + message->length > fMessageQueue.msg_qbytes
|| sXsiMessageCount <= MAX_XSI_MESSAGE)
|| sXsiMessageCount >= MAX_XSI_MESSAGE)
return true;
fMessage.Add(message);