diff options
author | Florin Coras <fcoras@cisco.com> | 2021-02-15 11:56:46 -0800 |
---|---|---|
committer | Dave Barach <openvpp@barachs.net> | 2021-02-15 23:42:50 +0000 |
commit | f9db7f0ff51e3c212f70d38c5e4fa68e07b82a96 (patch) | |
tree | b22470ebbbe73835fb7de37d4f852b59918c771e /src | |
parent | eef15396f69bdb817e9ac2c9b791750be0ce0d4f (diff) |
svm: fix mq coverity warning
Type: fix
Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I1914366c17fa05305d57d842793fad372319256a
Diffstat (limited to 'src')
-rw-r--r-- | src/svm/message_queue.c | 9 |
1 files changed, 7 insertions, 2 deletions
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) |