From c873faa390b20fd00672ef690b75e6572adba5a0 Mon Sep 17 00:00:00 2001 From: Alexander Boettcher Date: Mon, 25 Jun 2012 14:56:46 +0200 Subject: [PATCH] Fix: reset word counter in case of failed IPC. If IPC fails for some reasons, reset received counter of items+words. This operation is not performed by the kernel. --- base-nova/src/base/ipc/ipc.cc | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/base-nova/src/base/ipc/ipc.cc b/base-nova/src/base/ipc/ipc.cc index 8f2f8f3cb..6e9031661 100644 --- a/base-nova/src/base/ipc/ipc.cc +++ b/base-nova/src/base/ipc/ipc.cc @@ -138,11 +138,12 @@ void Ipc_client::_call() _rcv_msg->rcv_prepare_pt_sel_window(utcb); /* establish the mapping via a portal traversal */ - if (Ipc_ostream::_dst.dst() == 0) - PWRN("destination portal is zero"); - int res = Nova::call(Ipc_ostream::_dst.dst()); - if (res) - PERR("call returned %d", res); + uint8_t res = Nova::call(Ipc_ostream::_dst.dst()); + if (res) { + /* If an error occurred, reset word&item count (not done by kernel). */ + utcb->set_msg_word(0); + PERR("call returned %u", res); + } copy_utcb_to_msgbuf(utcb, _rcv_msg); _snd_msg->snd_reset();