From 2eb0d9c7e6a8effd3510cabdb5d5f385a71a2a37 Mon Sep 17 00:00:00 2001 From: Suman Anna Date: Thu, 30 Apr 2015 19:23:41 -0500 Subject: [PATCH] Linux/TransportRpmsg: Shutdown only on MessageQ_E_SHUTDOWN The transportGet() function returns a specific error code MessageQ_E_SHUTDOWN to denote that a remote processor has crashed. Revise the logic in rpmsgThreadFxn to perform the receive socket cleanup and passing on the message to MessageQ clients _only_ on this error code. The MessageQ shutdown behavior was introduced in commit 067ad27 ("Add fault tolerance for TransportRpmsg socket failure"), and caused the shutdown to be executed for all other error codes on transportGet() as well. Fixes: 067ad27 ("Add fault tolerance for TransportRpmsg socket failure") Signed-off-by: Suman Anna --- linux/src/transport/TransportRpmsg.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/linux/src/transport/TransportRpmsg.c b/linux/src/transport/TransportRpmsg.c index ed3de5e..fcc6fb6 100644 --- a/linux/src/transport/TransportRpmsg.c +++ b/linux/src/transport/TransportRpmsg.c @@ -522,7 +522,11 @@ void *rpmsgThreadFxn(void *arg) /* transport input fd was signalled: get the message */ tmpStatus = transportGet(fd, &retMsg); - if (tmpStatus < 0) { + if (tmpStatus < 0 && tmpStatus != MessageQ_E_SHUTDOWN) { + printf("rpmsgThreadFxn: transportGet failed on fd %d," + " returned %d\n", fd, tmpStatus); + } + else if (tmpStatus == MessageQ_E_SHUTDOWN) { printf("rpmsgThreadFxn: transportGet failed on fd %d," " returned %d\n", fd, tmpStatus); -- 2.39.2