]> git.proxmox.com Git - mirror_qemu.git/commitdiff
qemu_pipe() is used only by POSIX code, so move to oslib-posix.c
authorJes Sorensen <Jes.Sorensen@redhat.com>
Tue, 26 Oct 2010 08:39:21 +0000 (10:39 +0200)
committerBlue Swirl <blauwirbel@gmail.com>
Sat, 30 Oct 2010 08:02:37 +0000 (08:02 +0000)
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
osdep.c
oslib-posix.c

diff --git a/osdep.c b/osdep.c
index 902fce94bbb56b86a03dd25e64e88067d960a0ca..926c8adb680e62c65c2bbea9be5763759245f2a5 100644 (file)
--- a/osdep.c
+++ b/osdep.c
@@ -235,28 +235,6 @@ int qemu_eventfd(int fds[2])
 
     return qemu_pipe(fds);
 }
-
-/*
- * Creates a pipe with FD_CLOEXEC set on both file descriptors
- */
-int qemu_pipe(int pipefd[2])
-{
-    int ret;
-
-#ifdef CONFIG_PIPE2
-    ret = pipe2(pipefd, O_CLOEXEC);
-    if (ret != -1 || errno != ENOSYS) {
-        return ret;
-    }
-#endif
-    ret = pipe(pipefd);
-    if (ret == 0) {
-        qemu_set_cloexec(pipefd[0]);
-        qemu_set_cloexec(pipefd[1]);
-    }
-
-    return ret;
-}
 #endif
 
 /*
index aebe3ac0431644df0021488a0c6c80a811b2b473..ad44b1763782e98757f121d83abb23cd8449f411 100644 (file)
@@ -87,3 +87,25 @@ void qemu_set_cloexec(int fd)
     f = fcntl(fd, F_GETFD);
     fcntl(fd, F_SETFD, f | FD_CLOEXEC);
 }
+
+/*
+ * Creates a pipe with FD_CLOEXEC set on both file descriptors
+ */
+int qemu_pipe(int pipefd[2])
+{
+    int ret;
+
+#ifdef CONFIG_PIPE2
+    ret = pipe2(pipefd, O_CLOEXEC);
+    if (ret != -1 || errno != ENOSYS) {
+        return ret;
+    }
+#endif
+    ret = pipe(pipefd);
+    if (ret == 0) {
+        qemu_set_cloexec(pipefd[0]);
+        qemu_set_cloexec(pipefd[1]);
+    }
+
+    return ret;
+}