From f0275b1e5a4787da1f4d5507165315a000c22b33 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Thu, 26 May 2016 00:19:55 -0700 Subject: os: Leave stdin and stdout open There's no reason to close these now that we don't care what file descriptors we use. Signed-off-by: Keith Packard Reviewed-by: Adam Jackson --- os/osinit.c | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/os/osinit.c b/os/osinit.c index ab9c1d657..47061bb2b 100644 --- a/os/osinit.c +++ b/os/osinit.c @@ -224,17 +224,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 -- cgit v1.2.3