aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJes Sorensen <Jes.Sorensen@redhat.com>2010-10-26 10:39:21 +0200
committerBlue Swirl <blauwirbel@gmail.com>2010-10-30 08:02:37 +0000
commit70e72ce45e1f06415b5ec28439c2a87a72e5aad3 (patch)
tree9773bc8999946a914c0c63e73bcf195969054935
parent9549e764bdc24b085cb1bb87400bf6ef79ae9eb1 (diff)
downloadqemu-70e72ce45e1f06415b5ec28439c2a87a72e5aad3.zip
qemu-70e72ce45e1f06415b5ec28439c2a87a72e5aad3.tar.gz
qemu-70e72ce45e1f06415b5ec28439c2a87a72e5aad3.tar.bz2
qemu_pipe() is used only by POSIX code, so move to oslib-posix.c
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
-rw-r--r--osdep.c22
-rw-r--r--oslib-posix.c22
2 files changed, 22 insertions, 22 deletions
diff --git a/osdep.c b/osdep.c
index 902fce9..926c8ad 100644
--- 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
/*
diff --git a/oslib-posix.c b/oslib-posix.c
index aebe3ac..ad44b17 100644
--- a/oslib-posix.c
+++ b/oslib-posix.c
@@ -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;
+}