mirror of
https://github.com/gnustep/libs-base.git
synced 2025-06-02 17:41:05 +00:00
win32 fixes
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@24402 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
fdcd37b4c6
commit
dcb2830fc1
2 changed files with 29 additions and 9 deletions
|
@ -1,3 +1,9 @@
|
||||||
|
2007-01-23 Richard Frith-Macdonald <rfm@gnu.org>
|
||||||
|
|
||||||
|
* Source/win32/NSMessagePortNameServerWin32.m:
|
||||||
|
* Source/win32/NSMessagePortWin32.m:
|
||||||
|
Bugfixes to try to make win32 nameserver operation more reliable.
|
||||||
|
|
||||||
2007-01-19 Richard Frith-Macdonald <rfm@gnu.org>
|
2007-01-19 Richard Frith-Macdonald <rfm@gnu.org>
|
||||||
|
|
||||||
* Tools/defaults.m: Make errors go to stderr and be more informative.
|
* Tools/defaults.m: Make errors go to stderr and be more informative.
|
||||||
|
|
|
@ -206,12 +206,6 @@ static Class messagePortClass = 0;
|
||||||
p = [[self alloc] initWithName: name];
|
p = [[self alloc] initWithName: name];
|
||||||
}
|
}
|
||||||
M_UNLOCK(messagePortLock);
|
M_UNLOCK(messagePortLock);
|
||||||
if ([p _setupSendPort] == NO)
|
|
||||||
{
|
|
||||||
NSLog(@"unable to access mailslot '%@' - %@",
|
|
||||||
[p name], [NSError _last]);
|
|
||||||
DESTROY(p);
|
|
||||||
}
|
|
||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -364,6 +358,7 @@ static Class messagePortClass = 0;
|
||||||
- (id) initWithName: (NSString*)name
|
- (id) initWithName: (NSString*)name
|
||||||
{
|
{
|
||||||
NSMessagePort *p;
|
NSMessagePort *p;
|
||||||
|
BOOL found = NO;
|
||||||
|
|
||||||
M_LOCK(messagePortLock);
|
M_LOCK(messagePortLock);
|
||||||
p = RETAIN((NSMessagePort*)NSMapGet(ports, (void*)name));
|
p = RETAIN((NSMessagePort*)NSMapGet(ports, (void*)name));
|
||||||
|
@ -385,15 +380,34 @@ static Class messagePortClass = 0;
|
||||||
this->rEvent = INVALID_HANDLE_VALUE;
|
this->rEvent = INVALID_HANDLE_VALUE;
|
||||||
this->wHandle = INVALID_HANDLE_VALUE;
|
this->wHandle = INVALID_HANDLE_VALUE;
|
||||||
this->wEvent = INVALID_HANDLE_VALUE;
|
this->wEvent = INVALID_HANDLE_VALUE;
|
||||||
|
|
||||||
NSMapInsert(ports, (void*)this->name, (void*)self);
|
|
||||||
NSDebugMLLog(@"NSMessagePort", @"Created speaking port: %@", self);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
found = YES;
|
||||||
RELEASE(self);
|
RELEASE(self);
|
||||||
self = p;
|
self = p;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* This is a 'speaking' port ... set it up for write operation
|
||||||
|
* if necessary.
|
||||||
|
* NB. This must be done (to create the mailbox) before the port
|
||||||
|
* is added to the nameserver mapping ... or nother process might
|
||||||
|
* try to access the mailbox before it exists.
|
||||||
|
*/
|
||||||
|
if ([self _setupSendPort] == NO)
|
||||||
|
{
|
||||||
|
NSLog(@"unable to access mailslot '%@' - %@",
|
||||||
|
[self name], [NSError _last]);
|
||||||
|
DESTROY(self);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (self != nil && found == NO)
|
||||||
|
{
|
||||||
|
/* This was newly created ... add to map so that it can be found.
|
||||||
|
*/
|
||||||
|
NSMapInsert(ports, (void*)[self name], (void*)self);
|
||||||
|
NSDebugMLLog(@"NSMessagePort", @"Created speaking port: %@", self);
|
||||||
|
}
|
||||||
M_UNLOCK(messagePortLock);
|
M_UNLOCK(messagePortLock);
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue