From 8526dc4f1935f57716c30aeecbe5eae9fcec4520 Mon Sep 17 00:00:00 2001 From: Alexander Boettcher Date: Fri, 10 Aug 2012 09:25:22 +0200 Subject: [PATCH] Set ERR_INVALID_OBEJCT if call failed to server Tell the client that the last operation failed, instead of continuing doing useless things. --- base-nova/src/base/ipc/ipc.cc | 5 +++-- base/include/base/ipc_generic.h | 8 ++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/base-nova/src/base/ipc/ipc.cc b/base-nova/src/base/ipc/ipc.cc index fa645e542..02c9a9445 100644 --- a/base-nova/src/base/ipc/ipc.cc +++ b/base-nova/src/base/ipc/ipc.cc @@ -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); diff --git a/base/include/base/ipc_generic.h b/base/include/base/ipc_generic.h index 7bfe2169e..cc397751e 100644 --- a/base/include/base/ipc_generic.h +++ b/base/include/base/ipc_generic.h @@ -421,6 +421,14 @@ namespace Genode { */ void _call(); + /** + * Set return value if call to server failed + */ + void ret(int retval) + { + *reinterpret_cast(&_rcvbuf[sizeof(umword_t)]) = retval; + } + public: /**