mirror of
https://github.com/genodelabs/genode.git
synced 2025-03-23 04:25:21 +00:00
Set ERR_INVALID_OBEJCT if call failed to server
Tell the client that the last operation failed, instead of continuing doing useless things.
This commit is contained in:
parent
c06c2887f2
commit
8526dc4f19
@ -144,10 +144,11 @@ void Ipc_client::_call()
|
||||
|
||||
/* establish the mapping via a portal traversal */
|
||||
uint8_t res = Nova::call(Ipc_ostream::_dst.local_name());
|
||||
if (res) {
|
||||
if (res != Nova::NOVA_OK) {
|
||||
/* If an error occurred, reset word&item count (not done by kernel). */
|
||||
utcb->set_msg_word(0);
|
||||
PERR("call returned %u", res);
|
||||
/* set return value for ipc_generic part if call failed */
|
||||
ret(ERR_INVALID_OBJECT);
|
||||
}
|
||||
|
||||
_rcv_msg->post_ipc(utcb);
|
||||
|
@ -421,6 +421,14 @@ namespace Genode {
|
||||
*/
|
||||
void _call();
|
||||
|
||||
/**
|
||||
* Set return value if call to server failed
|
||||
*/
|
||||
void ret(int retval)
|
||||
{
|
||||
*reinterpret_cast<int *>(&_rcvbuf[sizeof(umword_t)]) = retval;
|
||||
}
|
||||
|
||||
public:
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user