aboutsummaryrefslogtreecommitdiff
path: root/hw/9pfs
diff options
context:
space:
mode:
authorKirill A. Shutemov <kirill.shutemov@linux.intel.com>2014-01-28 17:08:24 +0200
committerAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>2014-02-02 22:08:41 +0530
commit0e5fc994d24af4f4f9a1368bf9c2e730c120c549 (patch)
tree5adb446bb5a64d7af440c01247725a8be299ba9b /hw/9pfs
parent2f61120c10da9128357510debc8e66880cd2bfdc (diff)
hw/9pfs: fix error handing in local_ioc_getversion()
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 <kirill.shutemov@linux.intel.com> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Diffstat (limited to 'hw/9pfs')
-rw-r--r--hw/9pfs/virtio-9p-local.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/hw/9pfs/virtio-9p-local.c b/hw/9pfs/virtio-9p-local.c
index fc93e9e6e8..9be8854e91 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)