Fix issue reported by Coverity.
Coverity ID 13194
The function returns a value that indicates an error condition. If this
is not checked, the error condition may not be handled correctly.
Fixes:
2f4adfad0a69 ("vfio: add multiprocess support")
Signed-off-by: Daniel Mrzyglod <danielx.t.mrzyglod@intel.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
struct linger l;
l.l_onoff = 1;
l.l_linger = 60;
- setsockopt(conn_sock, SOL_SOCKET, SO_LINGER, &l, sizeof(l));
+
+ if (setsockopt(conn_sock, SOL_SOCKET, SO_LINGER, &l, sizeof(l)) < 0)
+ RTE_LOG(WARNING, EAL, "Cannot set SO_LINGER option "
+ "on listen socket (%s)\n", strerror(errno));
ret = vfio_mp_sync_receive_request(conn_sock);