mirror of
https://github.com/gnustep/libs-base.git
synced 2025-06-01 09:02:01 +00:00
Improved warnign messages
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@3343 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
09b61cd598
commit
7b25702d5f
1 changed files with 28 additions and 3 deletions
|
@ -33,6 +33,7 @@
|
||||||
#include <Foundation/NSPort.h>
|
#include <Foundation/NSPort.h>
|
||||||
#include <Foundation/NSMapTable.h>
|
#include <Foundation/NSMapTable.h>
|
||||||
#include <Foundation/NSSet.h>
|
#include <Foundation/NSSet.h>
|
||||||
|
#include <Foundation/NSHost.h>
|
||||||
#include <Foundation/NSPortNameServer.h>
|
#include <Foundation/NSPortNameServer.h>
|
||||||
#include <gnustep/base/TcpPort.h>
|
#include <gnustep/base/TcpPort.h>
|
||||||
|
|
||||||
|
@ -779,6 +780,7 @@ static NSPortNameServer *defaultServer = nil;
|
||||||
{
|
{
|
||||||
NSRunLoop *loop;
|
NSRunLoop *loop;
|
||||||
NSString *hostname = host;
|
NSString *hostname = host;
|
||||||
|
BOOL isLocal = NO;
|
||||||
|
|
||||||
if (handle)
|
if (handle)
|
||||||
{
|
{
|
||||||
|
@ -787,6 +789,21 @@ static NSPortNameServer *defaultServer = nil;
|
||||||
if (hostname == nil)
|
if (hostname == nil)
|
||||||
{
|
{
|
||||||
hostname = @"localhost";
|
hostname = @"localhost";
|
||||||
|
isLocal = YES;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
NSHost *current = [NSHost currentHost];
|
||||||
|
NSHost *host = [NSHost hostWithName: hostname];
|
||||||
|
|
||||||
|
if (host == nil)
|
||||||
|
{
|
||||||
|
host = [NSHost hostWithAddress: hostname];
|
||||||
|
}
|
||||||
|
if ([current isEqual: host])
|
||||||
|
{
|
||||||
|
isLocal = YES;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_DURING
|
NS_DURING
|
||||||
|
@ -864,7 +881,7 @@ static NSPortNameServer *defaultServer = nil;
|
||||||
static BOOL retrying = NO;
|
static BOOL retrying = NO;
|
||||||
|
|
||||||
[self _close];
|
[self _close];
|
||||||
if (retrying == NO)
|
if (isLocal == YES && retrying == NO)
|
||||||
{
|
{
|
||||||
retrying = YES;
|
retrying = YES;
|
||||||
NS_DURING
|
NS_DURING
|
||||||
|
@ -880,10 +897,18 @@ static NSPortNameServer *defaultServer = nil;
|
||||||
retrying = NO;
|
retrying = NO;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
|
if (isLocal)
|
||||||
{
|
{
|
||||||
NSLog(@"NSPortNameServer failed to connect to gdomap - %s",
|
NSLog(@"NSPortNameServer failed to connect to gdomap - %s",
|
||||||
make_gdomap_err(GNUSTEP_INSTALL_PREFIX));
|
make_gdomap_err(GNUSTEP_INSTALL_PREFIX));
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
NSLog(@"NSPortNameServer failed to connect to gdomap on %@",
|
||||||
|
hostname);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue