qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 1/4] hw/9pfs: fix error handing in local_ioc_get


From: Aneesh Kumar K.V
Subject: Re: [Qemu-devel] [PATCH 1/4] hw/9pfs: fix error handing in local_ioc_getversion()
Date: Sun, 02 Feb 2014 21:50:27 +0530
User-agent: Notmuch/0.17+7~gc734dd75344e (http://notmuchmail.org) Emacs/24.3.1 (x86_64-pc-linux-gnu)

"Kirill A. Shutemov" <address@hidden> writes:

> 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 <address@hidden>

Reviewed-by: Aneesh Kumar K.V <address@hidden>

> ---
>  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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]