aboutsummaryrefslogtreecommitdiff
path: root/hw/9pfs/virtio-9p-local.c
diff options
context:
space:
mode:
authorKirill A. Shutemov <kirill.shutemov@linux.intel.com>2014-01-28 17:08:26 +0200
committerAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>2014-02-02 22:09:04 +0530
commit1a9978a51a17a26fd07e1b46f31ceeb9772fc191 (patch)
treed63ea3833b5de533042e4bf9e35638201e7f6ea1 /hw/9pfs/virtio-9p-local.c
parentb9317661d13230ec9fd1162625b7f812c0cacd37 (diff)
downloadqemu-1a9978a51a17a26fd07e1b46f31ceeb9772fc191.zip
qemu-1a9978a51a17a26fd07e1b46f31ceeb9772fc191.tar.gz
qemu-1a9978a51a17a26fd07e1b46f31ceeb9772fc191.tar.bz2
hw/9pfs: make get_st_gen() return ENOTTY error on special files
Currently we silently ignore getversion requests for anything except file or directory. Let's instead return ENOTTY error to indicate that getversion is not supported. It makes implementation consistent on all not-supported cases. 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/virtio-9p-local.c')
-rw-r--r--hw/9pfs/virtio-9p-local.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/hw/9pfs/virtio-9p-local.c b/hw/9pfs/virtio-9p-local.c
index 9be8854..df0dbff 100644
--- a/hw/9pfs/virtio-9p-local.c
+++ b/hw/9pfs/virtio-9p-local.c
@@ -1077,7 +1077,8 @@ static int local_ioc_getversion(FsContext *ctx, V9fsPath *path,
* We can get fd for regular files and directories only
*/
if (!S_ISREG(st_mode) && !S_ISDIR(st_mode)) {
- return 0;
+ errno = ENOTTY;
+ return -1;
}
err = local_open(ctx, path, O_RDONLY, &fid_open);
if (err < 0) {