mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* win32/win32.c (init_stdhandle): assign standard file handles.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7937 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
8c5bd041b6
commit
6400a671b8
2 changed files with 26 additions and 0 deletions
|
@ -1,3 +1,7 @@
|
|||
Thu Feb 10 12:06:31 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* win32/win32.c (init_stdhandle): assign standard file handles.
|
||||
|
||||
Wed Feb 9 16:33:05 2005 NAKAMURA Usaku <usa@ruby-lang.org>
|
||||
|
||||
* ext/socket/socket.c (wait_connectable): fixed wrong condition.
|
||||
|
|
|
@ -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__
|
||||
|
|
Loading…
Add table
Reference in a new issue