From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41307) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W8AHO-0006dd-6Y for qemu-devel@nongnu.org; Tue, 28 Jan 2014 10:08:51 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W8AHH-0002HX-TM for qemu-devel@nongnu.org; Tue, 28 Jan 2014 10:08:46 -0500 Received: from mga01.intel.com ([192.55.52.88]:36468) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W8AHH-0002HH-Nn for qemu-devel@nongnu.org; Tue, 28 Jan 2014 10:08:39 -0500 From: "Kirill A. Shutemov" Date: Tue, 28 Jan 2014 17:08:24 +0200 Message-Id: <1390921707-15109-1-git-send-email-kirill.shutemov@linux.intel.com> Subject: [Qemu-devel] [PATCH 1/4] hw/9pfs: fix error handing in local_ioc_getversion() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org, aliguori@amazon.com, mst@redhat.com Cc: aneesh.kumar@linux.vnet.ibm.com, "Kirill A. Shutemov" , armbru@redhat.com v9fs_co_st_gen() expects to see error code in errno, not in return code. Let's fix this. Signed-off-by: Kirill A. Shutemov --- hw/9pfs/virtio-9p-local.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/hw/9pfs/virtio-9p-local.c b/hw/9pfs/virtio-9p-local.c index fc93e9e6e8da..9be8854e9148 100644 --- a/hw/9pfs/virtio-9p-local.c +++ b/hw/9pfs/virtio-9p-local.c @@ -1068,8 +1068,8 @@ err_out: static int local_ioc_getversion(FsContext *ctx, V9fsPath *path, mode_t st_mode, uint64_t *st_gen) { - int err; #ifdef FS_IOC_GETVERSION + int err; V9fsFidOpenState fid_open; /* @@ -1085,10 +1085,11 @@ static int local_ioc_getversion(FsContext *ctx, V9fsPath *path, } err = ioctl(fid_open.fd, FS_IOC_GETVERSION, st_gen); local_close(ctx, &fid_open); + return err; #else - err = -ENOTTY; + errno = ENOTTY; + return -1; #endif - return err; } static int local_init(FsContext *ctx) -- 1.8.5.2