[PATCH V3 2/3] tools: acrnd: Fixed get_sos_wakeup_reason()


Tao, Yuhong
 

get_sos_wakeup_reason() runs into error branch without any error, so
no wakeup reason will be returend.

Signed-off-by: Tao Yuhong <yuhong.tao@...>
---
tools/acrn-manager/acrnd.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/acrn-manager/acrnd.c b/tools/acrn-manager/acrnd.c
index 3b47bdd..f1eb338 100644
--- a/tools/acrn-manager/acrnd.c
+++ b/tools/acrn-manager/acrnd.c
@@ -284,7 +284,7 @@ unsigned get_sos_wakeup_reason(void)
req.msgid = WAKEUP_REASON;
req.timestamp = time(NULL);

- if (mngr_send_msg(client_fd, &req, &ack, DEFAULT_TIMEOUT))
+ if (mngr_send_msg(client_fd, &req, &ack, DEFAULT_TIMEOUT) <= 0)
fprintf(stderr, "Failed to get wakeup_reason from SOS, err(%d)\n", ret);
else
ret = ack.data.reason;
--
2.7.4

Join acrn-dev@lists.projectacrn.org to automatically receive all group messages.