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>
This commit is contained in:
Keith Packard 2016-05-26 00:19:55 -07:00 committed by Adam Jackson
parent 8217c29d2d
commit f0275b1e5a

View File

@ -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