subprojects, testing fiex

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@3762 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
fedor 1999-02-19 21:47:15 +00:00
parent 3c7d220858
commit 6a75fb2858
4 changed files with 38 additions and 3 deletions

View file

@ -155,6 +155,12 @@ static NSMutableDictionary *_hostCache = nil;
}
h = gethostbyname(name);
if (h == NULL)
{
NSLog(@"Unable to determine current host");
return nil;
}
return [self _hostWithHostEntry:h name:[NSString
stringWithCString:name]];
@ -163,6 +169,12 @@ static NSMutableDictionary *_hostCache = nil;
+ (NSHost *)hostWithName:(NSString *)name
{
struct hostent *h;
if (name == nil)
{
NSLog(@"Nil host name sent to +[NSHost hostWithName]");
return nil;
}
h = gethostbyname((char *)[name cString]);
@ -175,6 +187,12 @@ static NSMutableDictionary *_hostCache = nil;
struct hostent *h;
struct in_addr hostaddr;
if (address == nil)
{
NSLog(@"Nil address sent to +[NSHost hostWithAddress]");
return nil;
}
hostaddr.s_addr = inet_addr((char *)[address cString]);
if (hostaddr.s_addr == -1)
{