diff --git a/ChangeLog b/ChangeLog index 90278d816..babefeab2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,8 @@ 2009-09-30 Richard Frith-Macdonald * Source/NSLock.m: Fix BOOL methods to return YES or NO. + * Source/win32/GSFileHandle.m: Implement nul device handle. + * Source/NSTask.m: Try to avoid annoying colsole window with mingw32 2009-09-27 Richard Frith-Macdonald diff --git a/Source/NSTask.m b/Source/NSTask.m index fad89f7ae..eb9e93f33 100644 --- a/Source/NSTask.m +++ b/Source/NSTask.m @@ -1222,6 +1222,11 @@ quotedFromString(NSString *aString) } hErr = start_info.hStdError; + /* Tell the system not to show a window for the subtask. + */ + start_info.wShowWindow = SW_HIDE; + start_info.dwFlags |= STARTF_USESHOWWINDOW; + /* Make the handles inheritable only temporarily while launching the * child task. This section must be lock protected so we don't have * another thread trying to launch at the same time and get handles @@ -1238,11 +1243,16 @@ quotedFromString(NSString *aString) NULL, /* thread attrs */ 1, /* inherit handles */ 0 -// |CREATE_NO_WINDOW + |CREATE_NO_WINDOW /* One would have thought the the CREATE_NO_WINDOW flag should be used, * but apparently this breaks for old 16bit applications/tools on XP. + * So maybe we want to leave it out? + */ +// |DETACHED_PROCESS +/* We don't set the DETACHED_PROCESS flag as it actually means that the + * child task should get a new Console allocated ... and that means it + * will pop up a console window ... which looks really bad. */ - |DETACHED_PROCESS |CREATE_UNICODE_ENVIRONMENT, envp, /* env block */ (const unichar*)[[self currentDirectoryPath] fileSystemRepresentation], diff --git a/Source/win32/GSFileHandle.m b/Source/win32/GSFileHandle.m index 41264ec61..9b61e6f3b 100644 --- a/Source/win32/GSFileHandle.m +++ b/Source/win32/GSFileHandle.m @@ -1085,10 +1085,25 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr"; - (id) initWithNullDevice { - isNullDevice = YES; - isStandardFile = YES; - descriptor = -1; - return self; + int d = _open("NUL", O_RDWR|O_BINARY); + + if (d < 0) + { + RELEASE(self); + return nil; + } + else + { + self = [self initWithFileDescriptor: d closeOnDealloc: YES]; + if (self != nil) + { + connectOK = NO; + acceptOK = NO; + isNullDevice = YES; + isStandardFile = YES; + } + return self; + } } - (id) initWithFileDescriptor: (int)desc closeOnDealloc: (BOOL)flag