From: Florin Coras Date: Mon, 15 Feb 2021 19:56:46 +0000 (-0800) Subject: svm: fix mq coverity warning X-Git-Tag: v21.10-rc0~522 X-Git-Url: https://gerrit.fd.io/r/gitweb?a=commitdiff_plain;h=f9db7f0ff51e3c212f70d38c5e4fa68e07b82a96;p=vpp.git svm: fix mq coverity warning Type: fix Signed-off-by: Florin Coras Change-Id: I1914366c17fa05305d57d842793fad372319256a --- diff --git a/MAINTAINERS b/MAINTAINERS index ea5a28d0aa3..6003a817e30 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -532,7 +532,7 @@ F: src/plugins/mdata/ Plugin - Unit Tests I: unittest M: Dave Barach -M: Florin Coras F: src/plugins/unittest/ Test Infrastructure diff --git a/src/svm/message_queue.c b/src/svm/message_queue.c index b423826cb83..8be6be7686f 100644 --- a/src/svm/message_queue.c +++ b/src/svm/message_queue.c @@ -570,8 +570,13 @@ svm_msg_q_timedwait (svm_msg_q_t *mq, double timeout) tv.tv_sec = (u64) timeout; tv.tv_usec = ((u64) timeout - (u64) timeout) * 1e9; - setsockopt (mq->q.evtfd, SOL_SOCKET, SO_RCVTIMEO, (const char *) &tv, - sizeof tv); + rv = setsockopt (mq->q.evtfd, SOL_SOCKET, SO_RCVTIMEO, + (const char *) &tv, sizeof tv); + if (rv < 0) + { + clib_unix_warning ("setsockopt"); + return -1; + } rv = read (mq->q.evtfd, &buf, sizeof (buf)); if (rv < 0)