diff options
-rw-r--r-- | util/vhost-user-server.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/util/vhost-user-server.c b/util/vhost-user-server.c index a7b7a9897f..981908fef0 100644 --- a/util/vhost-user-server.c +++ b/util/vhost-user-server.c @@ -169,8 +169,10 @@ vu_message_read(VuDev *vu_dev, int conn_fd, VhostUserMsg *vmsg) }; if (vmsg->size) { rc = qio_channel_readv_all_eof(ioc, &iov_payload, 1, &local_err); - if (rc == -1) { - error_report_err(local_err); + if (rc != 1) { + if (local_err) { + error_report_err(local_err); + } goto fail; } } |