From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=39500 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PAf4M-00081Q-7A for qemu-devel@nongnu.org; Tue, 26 Oct 2010 04:39:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PAf4D-0004vX-QO for qemu-devel@nongnu.org; Tue, 26 Oct 2010 04:39:38 -0400 Received: from mx1.redhat.com ([209.132.183.28]:15795) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PAf4D-0004vC-Jw for qemu-devel@nongnu.org; Tue, 26 Oct 2010 04:39:37 -0400 From: Jes.Sorensen@redhat.com Date: Tue, 26 Oct 2010 10:39:21 +0200 Message-Id: <1288082367-27944-4-git-send-email-Jes.Sorensen@redhat.com> In-Reply-To: <1288082367-27944-1-git-send-email-Jes.Sorensen@redhat.com> References: <1288082367-27944-1-git-send-email-Jes.Sorensen@redhat.com> Subject: [Qemu-devel] [PATCH 3/9] qemu_pipe() is used only by POSIX code, so move to oslib-posix.c List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: blauwirbel@gmail.com From: Jes Sorensen Signed-off-by: Jes Sorensen --- osdep.c | 22 ---------------------- oslib-posix.c | 22 ++++++++++++++++++++++ 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; +} -- 1.7.2.3