From: Gleb Natapov <gleb@redhat.com>
To: Cong Ding <dinggnu@gmail.com>
Cc: Pekka Enberg <penberg@kernel.org>,
Sasha Levin <levinsasha928@gmail.com>,
Asias He <asias.hejun@gmail.com>,
kvm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] kvm: close opened file
Date: Wed, 16 Jan 2013 13:35:22 +0200 [thread overview]
Message-ID: <20130116113522.GR11529@redhat.com> (raw)
In-Reply-To: <1358298456-18377-1-git-send-email-dinggnu@gmail.com>
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@gmail.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@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
--
Gleb.
next prev parent reply other threads:[~2013-01-16 11:35 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-16 1:07 [PATCH] kvm: close opened file Cong Ding
2013-01-16 1:07 ` [PATCH] kvm: remove redundant "if" condition Cong Ding
2013-01-16 11:35 ` Gleb Natapov [this message]
2013-01-16 16:51 ` [PATCH v2] kvm tools: close opened file Cong Ding
2013-01-19 8:57 ` Pekka Enberg
2013-01-16 16:52 ` [PATCH v2] kvm tools: remove redundant "if" condition Cong Ding
2013-01-19 8:58 ` Pekka Enberg
2013-01-19 10:27 ` Cong Ding
2013-01-22 19:52 ` Pekka Enberg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20130116113522.GR11529@redhat.com \
--to=gleb@redhat.com \
--cc=asias.hejun@gmail.com \
--cc=dinggnu@gmail.com \
--cc=kvm@vger.kernel.org \
--cc=levinsasha928@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=penberg@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.