]> Git Repo - qemu.git/commitdiff
raw-posix: Use qemu_dup
authorFam Zheng <[email protected]>
Wed, 22 Jun 2016 12:53:20 +0000 (20:53 +0800)
committerKevin Wolf <[email protected]>
Wed, 13 Jul 2016 11:26:02 +0000 (13:26 +0200)
Signed-off-by: Fam Zheng <[email protected]>
Reviewed-by: Max Reitz <[email protected]>
Reviewed-by: Kevin Wolf <[email protected]>
Reviewed-by: John Snow <[email protected]>
Signed-off-by: Kevin Wolf <[email protected]>
block/raw-posix.c

index c979ac3fd17922f8c1e3cf26279b3eb443b4c984..d1c3bd8e47076e8ac939b3c908c06d3916566a96 100644 (file)
@@ -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) {
This page took 0.031234 seconds and 4 git commands to generate.