Fix unchecked return value for fcntl.
Coverity issue: 277210
Fixes:
bd8f50a45d0f ("net/virtio-user: support server mode")
Cc: stable@dpdk.org
Signed-off-by: Chenbo Xia <chenbo.xia@intel.com>
Acked-by: Rami Rosen <ramirose@gmail.com>
Reviewed-by: Jens Freimann <jfreimann@redhat.com>
Reviewed-by: Tiwei Bie <tiwei.bie@intel.com>
return -1;
flag = fcntl(fd, F_GETFL);
- fcntl(fd, F_SETFL, flag | O_NONBLOCK);
+ if (fcntl(fd, F_SETFL, flag | O_NONBLOCK) < 0) {
+ PMD_DRV_LOG(ERR, "fcntl failed, %s", strerror(errno));
+ return -1;
+ }
return 0;
}