diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-02-10 03:06:43 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-02-10 03:06:43 +0000 |
commit | 1f9da5e23cb663cb22c820d60c0903495e916d56 (patch) | |
tree | 1b66b4ef72163534e59f610db8c941ac5d0c03e2 /win32 | |
parent | 43b696ac1dc527faed6db100eba7ce4f6f1a33a5 (diff) | |
download | ruby-1f9da5e23cb663cb22c820d60c0903495e916d56.tar.gz ruby-1f9da5e23cb663cb22c820d60c0903495e916d56.tar.xz ruby-1f9da5e23cb663cb22c820d60c0903495e916d56.zip |
* win32/win32.c (init_stdhandle): assign standard file handles.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@7937 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'win32')
-rw-r--r-- | win32/win32.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/win32/win32.c b/win32/win32.c index 9de71d7a2..92d00166b 100644 --- a/win32/win32.c +++ b/win32/win32.c @@ -409,6 +409,8 @@ static void init_env(void) NTLoginName[len] = '\0'; } +static void init_stdhandle(); + // // Initialization stuff // @@ -431,6 +433,8 @@ NtInitialize(int *argc, char ***argv) init_env(); + init_stdhandle(); + // Initialize Winsock StartSockets(); } @@ -1647,11 +1651,29 @@ rb_w32_open_osfhandle(long osfhandle, int flags) } return fh; /* return handle */ } + +static void +init_stdhandle() +{ + if (fileno(stdin) < 0) { + stdin->_file = 0; + } + if (fileno(stdout) < 0) { + stdout->_file = 1; + } + if (fileno(stderr) < 0) { + stderr->_file = 2; + } +} #else #define _set_osfhnd(fh, osfh) (void)((fh), (osfh)) #define _set_osflags(fh, flags) (void)((fh), (flags)) +static void +init_stdhandle() +{ +} #endif #ifdef __BORLANDC__ |