From: Roman Kagan Date: Thu, 11 Nov 2021 15:33:50 +0000 (+0300) Subject: vhost-backend: stick to -errno error return convention X-Git-Tag: v7.0.0-rc0~102^2~37 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2d88d9c65cc9680ff33cf8cc0b71ab1532e2f394;p=thirdparty%2Fqemu.git vhost-backend: stick to -errno error return convention Almost all VhostOps methods in kernel_ops follow the convention of returning negated errno on error. Adjust the only one that doesn't. Signed-off-by: Roman Kagan Message-Id: <20211111153354.18807-7-rvkagan@yandex-team.ru> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin Reviewed-by: Philippe Mathieu-Daudé --- diff --git a/hw/virtio/vhost-backend.c b/hw/virtio/vhost-backend.c index 44f7dbb2436..e409a865aeb 100644 --- a/hw/virtio/vhost-backend.c +++ b/hw/virtio/vhost-backend.c @@ -47,7 +47,7 @@ static int vhost_kernel_cleanup(struct vhost_dev *dev) assert(dev->vhost_ops->backend_type == VHOST_BACKEND_TYPE_KERNEL); - return close(fd); + return close(fd) < 0 ? -errno : 0; } static int vhost_kernel_memslots_limit(struct vhost_dev *dev)