From 1a9978a51a17a26fd07e1b46f31ceeb9772fc191 Mon Sep 17 00:00:00 2001 From: "Kirill A. Shutemov" Date: Tue, 28 Jan 2014 17:08:26 +0200 Subject: 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 Signed-off-by: Aneesh Kumar K.V --- hw/9pfs/virtio-9p-handle.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'hw/9pfs/virtio-9p-handle.c') diff --git a/hw/9pfs/virtio-9p-handle.c b/hw/9pfs/virtio-9p-handle.c index ed8c126e1d..17002a3d28 100644 --- a/hw/9pfs/virtio-9p-handle.c +++ b/hw/9pfs/virtio-9p-handle.c @@ -591,7 +591,8 @@ static int handle_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 = handle_open(ctx, path, O_RDONLY, &fid_open); if (err < 0) { -- cgit v1.2.1