Fixup host name

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@37804 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 2014-04-19 01:34:48 +00:00
parent 6829d65f68
commit 371454f0c3
3 changed files with 18 additions and 5 deletions

View file

@ -623,3 +623,9 @@ myHostName()
}
@end
@implementation NSHost (NSProcessInfo)
+ (NSString*) _myHostName
{
return myHostName();
}
@end

View file

@ -155,6 +155,10 @@ For more detailed assistance, please report the error to bug-gnustep@gnu.org.\n\
#endif
#endif
@interface NSHost (NSProcessInfo)
+ (NSString*) _myHostName;
@end
/*************************************************************************
*** _NSConcreteProcessInfo
*************************************************************************/
@ -1085,7 +1089,7 @@ int main(int argc, char *argv[], char *env[])
{
if (!_gnu_hostName)
{
_gnu_hostName = [[[NSHost currentHost] localizedName] copy];
_gnu_hostName = [[NSHost _myHostName] copy];
}
return _gnu_hostName;
}

View file

@ -36,12 +36,15 @@ int main()
"-globallyUniqueString works");
obj = [info operatingSystemName];
PASS((obj != nil &&
[obj isKindOfClass:[NSString class]] &&
[obj length] > 0),
"-operatingSystemName works");
PASS((obj != nil && [obj isKindOfClass:[NSString class]] && [obj length] > 0),
"-operatingSystemName works");
NSLog(@"operatingSystemName %@", obj);
val = [info operatingSystem];
PASS(val != 0, "-operatingSystem works");
obj = [info hostName];
PASS((obj != nil && [obj isKindOfClass:[NSString class]] && [obj length] > 0),
"-hostName works");
NSLog(@"hostName %@", obj);
[arp release]; arp = nil;
return 0;
}