mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-31 16:50:58 +00:00
Use inet_aton() where available
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@5247 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
9e3c780110
commit
a1e4758abf
2 changed files with 9 additions and 2 deletions
|
@ -6,6 +6,7 @@ Sun Nov 21 6:35:00 1999 Richard Frith-Macdonald <richard@brainstorm.co.uk>
|
||||||
* Source/UnixFileHandle.m: ([-availableData]) fixed to block when no
|
* Source/UnixFileHandle.m: ([-availableData]) fixed to block when no
|
||||||
data is availabvle on a comms channel - as per spec. This bug was
|
data is availabvle on a comms channel - as per spec. This bug was
|
||||||
also reported by Dan <dan@services.iirux.ro>
|
also reported by Dan <dan@services.iirux.ro>
|
||||||
|
* Source/NSHost.m: Use inet_aton() if available.
|
||||||
|
|
||||||
1999-11-18 Adam Fedor <fedor@gnu.org>
|
1999-11-18 Adam Fedor <fedor@gnu.org>
|
||||||
|
|
||||||
|
|
|
@ -204,12 +204,18 @@ static NSMutableDictionary*_hostCache = nil;
|
||||||
NSLog(@"Nil address sent to +[NSHost hostWithAddress]");
|
NSLog(@"Nil address sent to +[NSHost hostWithAddress]");
|
||||||
return nil;
|
return nil;
|
||||||
}
|
}
|
||||||
|
#ifndef HAVE_INET_ATON
|
||||||
hostaddr.s_addr = inet_addr((char*)[address cString]);
|
hostaddr.s_addr = inet_addr([address cString]);
|
||||||
if (hostaddr.s_addr == -1)
|
if (hostaddr.s_addr == -1)
|
||||||
{
|
{
|
||||||
return nil;
|
return nil;
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
if (inet_aton([address cString], &hostaddr.s_addr) == 0)
|
||||||
|
{
|
||||||
|
return nil;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
h = gethostbyaddr((char*)&hostaddr, sizeof(hostaddr), AF_INET);
|
h = gethostbyaddr((char*)&hostaddr, sizeof(hostaddr), AF_INET);
|
||||||
return [self _hostWithHostEntry: h];
|
return [self _hostWithHostEntry: h];
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue