Skip to content

Commit

Permalink
fix(port): read_port return value
Browse files Browse the repository at this point in the history
read_port should return the number of bytes written to the buffer
instead of `B_OK` on success.
  • Loading branch information
trungnt2910 committed Apr 12, 2023
1 parent e907550 commit 8f99075
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion haiku_loader/loader_debugger.cpp
Expand Up @@ -273,7 +273,7 @@ static int loader_debugger_nub_thread_entry(void*, void*)
status_t error = loader_hserver_call_read_port_etc(sNubPort, &op, &data, sizeof(data),
0, B_INFINITE_TIMEOUT);

if (error != B_OK)
if (error < 0)
{
// The debugger port is closed.
// This probably means the debugger is dead.
Expand Down
2 changes: 1 addition & 1 deletion hyclone_server/port.cpp
Expand Up @@ -460,7 +460,7 @@ intptr_t server_hserver_call_read_port_etc(hserver_context& context,
return B_BAD_ADDRESS;
}

return B_OK;
return writeSize;
}

intptr_t server_hserver_call_get_port_message_info_etc(hserver_context& context, int id,
Expand Down

0 comments on commit 8f99075

Please sign in to comment.