qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 1/4] hw/9pfs: fix error handing in local_ioc_getversion()
@ 2014-01-28 15:08 Kirill A. Shutemov
  2014-01-28 15:08 ` [Qemu-devel] [PATCH 2/4] hw/9pfs: handle undefined FS_IOC_GETVERSION case in handle_ioc_getversion() Kirill A. Shutemov
                   ` (4 more replies)
  0 siblings, 5 replies; 20+ messages in thread
From: Kirill A. Shutemov @ 2014-01-28 15:08 UTC (permalink / raw)
  To: qemu-devel, aliguori, mst; +Cc: aneesh.kumar, Kirill A. Shutemov, armbru

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>
---
 hw/9pfs/virtio-9p-local.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/hw/9pfs/virtio-9p-local.c b/hw/9pfs/virtio-9p-local.c
index fc93e9e6e8da..9be8854e9148 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)
-- 
1.8.5.2

^ permalink raw reply related	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2015-01-20 15:36 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-28 15:08 [Qemu-devel] [PATCH 1/4] hw/9pfs: fix error handing in local_ioc_getversion() Kirill A. Shutemov
2014-01-28 15:08 ` [Qemu-devel] [PATCH 2/4] hw/9pfs: handle undefined FS_IOC_GETVERSION case in handle_ioc_getversion() Kirill A. Shutemov
2014-02-02 16:20   ` Aneesh Kumar K.V
2014-01-28 15:08 ` [Qemu-devel] [PATCH 3/4] hw/9pfs: make get_st_gen() return ENOTTY error on special files Kirill A. Shutemov
2014-02-02 16:28   ` Aneesh Kumar K.V
2014-01-28 15:08 ` [Qemu-devel] [PATCH 4/4] hw/9pfs: fix P9_STATS_GEN handling Kirill A. Shutemov
2014-02-02 16:27   ` Aneesh Kumar K.V
2014-02-02 16:20 ` [Qemu-devel] [PATCH 1/4] hw/9pfs: fix error handing in local_ioc_getversion() Aneesh Kumar K.V
     [not found] ` <878utx5tw1.fsf@linux.vnet.ibm.com>
     [not found]   ` <87bnyp4e7k.fsf@linux.vnet.ibm.com>
2014-02-02 21:32     ` [Qemu-devel] 9pfs troubles (was Re: [PATCH 1/4] hw/9pfs: fix error handing in local_ioc_getversion()) Michael S. Tsirkin
2014-02-03  9:35       ` Aneesh Kumar K.V
2014-02-03 11:03         ` Michael S. Tsirkin
2014-02-04  7:21           ` Aneesh Kumar K.V
2014-02-05 21:31             ` Michael S. Tsirkin
2014-02-06 12:58               ` Aneesh Kumar K.V
2014-02-06 13:24                 ` Michael S. Tsirkin
2014-02-07  9:02               ` Greg Kurz
2014-02-09 12:05                 ` Michael S. Tsirkin
2014-03-12 11:34                 ` Michael S. Tsirkin
2014-03-17  9:12                   ` Greg Kurz
2015-01-20 15:36                     ` Marc-André Lureau

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).