summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2016-05-26 00:19:55 -0700
committerAdam Jackson <ajax@redhat.com>2016-07-21 15:04:47 -0400
commitf0275b1e5a4787da1f4d5507165315a000c22b33 (patch)
treeff6e3ea650a4c268a90cccbb839ee52a75a2f807
parent8217c29d2d8b29bd66bc54fee3fe5cb3385a05c7 (diff)
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 <keithp@keithp.com> Reviewed-by: Adam Jackson <ajax@redhat.com>
-rw-r--r--os/osinit.c11
1 files changed, 0 insertions, 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