mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* win32/win32.c (rb_w32_osid, rb_w32_osver, CreateChild): XP is
is different from Vista about pipe handle inheritance. fixed [ruby-core:17367] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17514 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
8fc91349e9
commit
7c936bcbb7
2 changed files with 21 additions and 3 deletions
|
@ -1,3 +1,9 @@
|
|||
Sun Jun 22 00:42:02 2008 NAKAMURA Usaku <usa@ruby-lang.org>
|
||||
|
||||
* win32/win32.c (rb_w32_osid, rb_w32_osver, CreateChild): XP is
|
||||
is different from Vista about pipe handle inheritance.
|
||||
fixed [ruby-core:17367]
|
||||
|
||||
Sun Jun 22 00:38:45 2008 NAKAMURA Usaku <usa@ruby-lang.org>
|
||||
|
||||
* README.EXT.ja: add note about mark and free.
|
||||
|
|
|
@ -200,14 +200,13 @@ rb_w32_map_errno(DWORD winerr)
|
|||
|
||||
static const char *NTLoginName;
|
||||
|
||||
static OSVERSIONINFO osver;
|
||||
#ifdef WIN95
|
||||
static DWORD Win32System = (DWORD)-1;
|
||||
|
||||
DWORD
|
||||
rb_w32_osid(void)
|
||||
{
|
||||
static OSVERSIONINFO osver;
|
||||
|
||||
if (osver.dwPlatformId != Win32System) {
|
||||
memset(&osver, 0, sizeof(OSVERSIONINFO));
|
||||
osver.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
|
||||
|
@ -217,6 +216,19 @@ rb_w32_osid(void)
|
|||
return (Win32System);
|
||||
}
|
||||
#endif
|
||||
static DWORD Win32Version = (DWORD)-1;
|
||||
|
||||
static DWORD
|
||||
rb_w32_osver(void)
|
||||
{
|
||||
if (osver.dwMajorVersion != Win32Version) {
|
||||
memset(&osver, 0, sizeof(OSVERSIONINFO));
|
||||
osver.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
|
||||
GetVersionEx(&osver);
|
||||
Win32Version = osver.dwMajorVersion;
|
||||
}
|
||||
return (Win32Version);
|
||||
}
|
||||
|
||||
#define IsWinNT() rb_w32_iswinnt()
|
||||
#define IsWin95() rb_w32_iswin95()
|
||||
|
@ -882,7 +894,7 @@ CreateChild(const char *cmd, const char *prog, SECURITY_ATTRIBUTES *psa,
|
|||
if (!psa) {
|
||||
sa.nLength = sizeof (SECURITY_ATTRIBUTES);
|
||||
sa.lpSecurityDescriptor = NULL;
|
||||
sa.bInheritHandle = FALSE;
|
||||
sa.bInheritHandle = IsWinNT() && rb_w32_osver() > 5 ? FALSE : TRUE;
|
||||
psa = &sa;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue