[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20130116113522.GR11529@redhat.com>
Date: Wed, 16 Jan 2013 13:35:22 +0200
From: Gleb Natapov <gleb@...hat.com>
To: Cong Ding <dinggnu@...il.com>
Cc: Pekka Enberg <penberg@...nel.org>,
Sasha Levin <levinsasha928@...il.com>,
Asias He <asias.hejun@...il.com>, kvm@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] kvm: close opened file
Please use "kvmtool:" prefix at the subject line.
On Wed, Jan 16, 2013 at 02:07:35AM +0100, Cong Ding wrote:
> The file should be closed before return.
>
> Signed-off-by: Cong Ding <dinggnu@...il.com>
> ---
> tools/kvm/builtin-setup.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/tools/kvm/builtin-setup.c b/tools/kvm/builtin-setup.c
> index c5b0566..8b45c56 100644
> --- a/tools/kvm/builtin-setup.c
> +++ b/tools/kvm/builtin-setup.c
> @@ -159,12 +159,12 @@ static int copy_passwd(const char *guestfs_name)
> return -1;
>
> ret = fprintf(file, "root:x:0:0:root:/root:/bin/sh\n");
> - if (ret < 0)
> - return ret;
> + if (ret > 0)
> + ret = 0;
>
> fclose(file);
>
> - return 0;
> + return ret;
> }
>
> static int make_guestfs_symlink(const char *guestfs_name, const char *path)
> --
> 1.7.10.4
>
> --
> To unsubscribe from this list: send the line "unsubscribe kvm" in
> the body of a message to majordomo@...r.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
--
Gleb.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists