mingw32 improvements

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@28755 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
rfm 2009-09-30 20:28:42 +00:00
parent 887039424c
commit 20f499656f
3 changed files with 33 additions and 6 deletions

View file

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