From: Fam Zheng <famz@redhat.com>
To: qemu-devel@nongnu.org
Cc: Kevin Wolf <kwolf@redhat.com>, Max Reitz <mreitz@redhat.com>,
qemu-block@nongnu.org
Subject: [Qemu-devel] [PATCH 2/2] raw-posix: Use qemu_dup
Date: Wed, 22 Jun 2016 16:02:11 +0800 [thread overview]
Message-ID: <20160622080211.7126-3-famz@redhat.com> (raw)
In-Reply-To: <20160622080211.7126-1-famz@redhat.com>
Signed-off-by: Fam Zheng <famz@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
---
block/raw-posix.c | 10 +---------
1 file changed, 1 insertion(+), 9 deletions(-)
diff --git a/block/raw-posix.c b/block/raw-posix.c
index bef7a67..c8ef64b 100644
--- a/block/raw-posix.c
+++ b/block/raw-posix.c
@@ -639,15 +639,7 @@ static int raw_reopen_prepare(BDRVReopenState *state,
if ((raw_s->open_flags & ~fcntl_flags) == (s->open_flags & ~fcntl_flags)) {
/* dup the original fd */
- /* TODO: use qemu fcntl wrapper */
-#ifdef F_DUPFD_CLOEXEC
- raw_s->fd = fcntl(s->fd, F_DUPFD_CLOEXEC, 0);
-#else
- raw_s->fd = dup(s->fd);
- if (raw_s->fd != -1) {
- qemu_set_cloexec(raw_s->fd);
- }
-#endif
+ raw_s->fd = qemu_dup(s->fd);
if (raw_s->fd >= 0) {
ret = fcntl_setfl(raw_s->fd, raw_s->open_flags);
if (ret) {
--
2.9.0
next prev parent reply other threads:[~2016-06-22 8:02 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-22 8:02 [Qemu-devel] [PATCH 0/2] block: Add qemu_dup in osdep.c and use it Fam Zheng
2016-06-22 8:02 ` [Qemu-devel] [PATCH 1/2] osdep: Introduce qemu_dup Fam Zheng
2016-06-22 12:27 ` Kevin Wolf
2016-06-22 12:38 ` Fam Zheng
2016-06-22 15:18 ` Eric Blake
2016-06-22 8:02 ` Fam Zheng [this message]
2016-06-22 12:28 ` [Qemu-devel] [PATCH 2/2] raw-posix: Use qemu_dup Kevin Wolf
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=20160622080211.7126-3-famz@redhat.com \
--to=famz@redhat.com \
--cc=kwolf@redhat.com \
--cc=mreitz@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.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 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).