From 04b4e75f33ae0775d70b8e33080f46d66275cdcc Mon Sep 17 00:00:00 2001 From: Luiz Capitulino Date: Thu, 10 May 2012 16:50:41 -0300 Subject: qemu-ga: make reopen_fd_to_null() public The next commit wants to use it. Signed-off-by: Luiz Capitulino Reviewed-by: Eric Blake Signed-off-by: Michael Roth --- qga/commands-posix.c | 19 ------------------- 1 file changed, 19 deletions(-) (limited to 'qga/commands-posix.c') diff --git a/qga/commands-posix.c b/qga/commands-posix.c index e448431..adb9b3d 100644 --- a/qga/commands-posix.c +++ b/qga/commands-posix.c @@ -34,25 +34,6 @@ #endif #endif -#if defined(__linux__) -/* TODO: use this in place of all post-fork() fclose(std*) callers */ -static void reopen_fd_to_null(int fd) -{ - int nullfd; - - nullfd = open("/dev/null", O_RDWR); - if (nullfd < 0) { - return; - } - - dup2(nullfd, fd); - - if (nullfd != fd) { - close(nullfd); - } -} -#endif /* defined(__linux__) */ - void qmp_guest_shutdown(bool has_mode, const char *mode, Error **err) { int ret; -- cgit v1.1