[PATCH xserver 23/23] os: Leave stdin and stdout open

Keith Packard keithp at keithp.com
Thu May 26 23:59:58 UTC 2016


There's no reason to close these now that we don't care what file
descriptors we use.

Signed-off-by: Keith Packard <keithp at keithp.com>
---
 os/osinit.c | 11 -----------
 1 file changed, 11 deletions(-)

diff --git a/os/osinit.c b/os/osinit.c
index 6ec2f11..e269957 100644
--- a/os/osinit.c
+++ b/os/osinit.c
@@ -221,17 +221,6 @@ OsInit(void)
 #endif
 
 #if !defined(XQUARTZ)    /* STDIN is already /dev/null and STDOUT/STDERR is managed by console_redirect.c */
-# if defined(__APPLE__)
-        int devnullfd = open(devnull, O_RDWR, 0);
-        assert(devnullfd > 2);
-
-        dup2(devnullfd, STDIN_FILENO);
-        dup2(devnullfd, STDOUT_FILENO);
-        close(devnullfd);
-# elif !defined(__CYGWIN__)
-        fclose(stdin);
-        fclose(stdout);
-# endif
         /*
          * If a write of zero bytes to stderr returns non-zero, i.e. -1,
          * then writing to stderr failed, and we'll write somewhere else
-- 
2.8.0.rc3



More information about the xorg-devel mailing list