]> Git Repo - qemu.git/commitdiff
hw/9pfs: fix error handing in local_ioc_getversion()
authorKirill A. Shutemov <[email protected]>
Tue, 28 Jan 2014 15:08:24 +0000 (17:08 +0200)
committerAneesh Kumar K.V <[email protected]>
Sun, 2 Feb 2014 16:38:41 +0000 (22:08 +0530)
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 <[email protected]>
Signed-off-by: Aneesh Kumar K.V <[email protected]>
hw/9pfs/virtio-9p-local.c

index fc93e9e6e8da6dac90c112eb2fd4c6e01ef757eb..9be8854e9148f3ea34a06d0c4cd37fb073521629 100644 (file)
@@ -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)
This page took 0.030297 seconds and 4 git commands to generate.