* 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:
@@ -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)
|
read_port(port_id port, int32 *msgCode, void *msgBuffer, size_t bufferSize)
|
||||||
{
|
{
|
||||||
return read_port_etc(port, msgCode, msgBuffer, bufferSize, 0, 0);
|
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,
|
read_port_etc(port_id id, int32 *_msgCode, void *msgBuffer, size_t bufferSize,
|
||||||
uint32 flags, bigtime_t timeout)
|
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,
|
_user_read_port_etc(port_id port, int32 *userCode, void *userBuffer,
|
||||||
size_t bufferSize, uint32 flags, bigtime_t timeout)
|
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,
|
status = read_port_etc(port, &messageCode, userBuffer, bufferSize,
|
||||||
flags | PORT_FLAG_USE_USER_MEMCPY | B_CAN_INTERRUPT, timeout);
|
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 B_BAD_ADDRESS;
|
||||||
|
|
||||||
return status;
|
return status;
|
||||||
|
|||||||
Reference in New Issue
Block a user