aboutsummaryrefslogtreecommitdiff
path: root/hw/9pfs/virtio-9p-local.c
diff options
context:
space:
mode:
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 9be8854e91..df0dbffa7a 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) {