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:
Alexander Boettcher 2012-08-10 09:25:22 +02:00 committed by Norman Feske
parent c06c2887f2
commit 8526dc4f19
2 changed files with 11 additions and 2 deletions

View File

@ -144,10 +144,11 @@ void Ipc_client::_call()
/* establish the mapping via a portal traversal */ /* establish the mapping via a portal traversal */
uint8_t res = Nova::call(Ipc_ostream::_dst.local_name()); 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). */ /* If an error occurred, reset word&item count (not done by kernel). */
utcb->set_msg_word(0); 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); _rcv_msg->post_ipc(utcb);

View File

@ -421,6 +421,14 @@ namespace Genode {
*/ */
void _call(); void _call();
/**
* Set return value if call to server failed
*/
void ret(int retval)
{
*reinterpret_cast<int *>(&_rcvbuf[sizeof(umword_t)]) = retval;
}
public: public:
/** /**