* Changed return value of read_port[_etc] from status_t to ssize_t. That's

not how it is declared in R5, but it is what actually is returned.
* Fixed _user_read_port_etc(): It didn't copy the message code back to
  userland, if the message had a size > 0.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10759 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold 2005-01-15 21:43:07 +00:00
parent 57b6c3bcad
commit 6fef29ae45

View File

@ -851,14 +851,14 @@ port_count(port_id id)
}
status_t
ssize_t
read_port(port_id port, int32 *msgCode, void *msgBuffer, size_t bufferSize)
{
return read_port_etc(port, msgCode, msgBuffer, bufferSize, 0, 0);
}
status_t
ssize_t
read_port_etc(port_id id, int32 *_msgCode, void *msgBuffer, size_t bufferSize,
uint32 flags, bigtime_t timeout)
{
@ -1208,7 +1208,7 @@ _user_port_count(port_id port)
}
status_t
ssize_t
_user_read_port_etc(port_id port, int32 *userCode, void *userBuffer,
size_t bufferSize, uint32 flags, bigtime_t timeout)
{
@ -1223,7 +1223,7 @@ _user_read_port_etc(port_id port, int32 *userCode, void *userBuffer,
status = read_port_etc(port, &messageCode, userBuffer, bufferSize,
flags | PORT_FLAG_USE_USER_MEMCPY | B_CAN_INTERRUPT, timeout);
if (status == B_OK && user_memcpy(userCode, &messageCode, sizeof(int32)) < B_OK)
if (status >= 0 && user_memcpy(userCode, &messageCode, sizeof(int32)) < B_OK)
return B_BAD_ADDRESS;
return status;