mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-23 09:04:13 +00:00
Minor improvement in usability
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@20064 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
d427f1afd3
commit
cd7e2f1453
2 changed files with 11 additions and 4 deletions
|
@ -3,6 +3,8 @@
|
|||
* Source/NSDateFormatter.m:
|
||||
* Source/NSNumberFormatter.m:
|
||||
Tolerate being given null pointers to return values in.
|
||||
* Tools/gdomap.c: Try both short and long forms of local host name.
|
||||
Report host name used when gethostbyname() fails.
|
||||
|
||||
2004-09-13 Adrian Robert <arobert@cogsci.ucsd.edu>
|
||||
|
||||
|
|
|
@ -3971,8 +3971,8 @@ donames(const char *host)
|
|||
unsigned short num = 0;
|
||||
int rval;
|
||||
uptr b;
|
||||
char *first_dot;
|
||||
char *local_hostname=NULL;
|
||||
char *first_dot = 0;
|
||||
char *local_hostname = NULL;
|
||||
|
||||
#if GDOMAP_PORT_OVERRIDE
|
||||
p = htons(GDOMAP_PORT_OVERRIDE);
|
||||
|
@ -4007,9 +4007,14 @@ donames(const char *host)
|
|||
}
|
||||
host = local_hostname;
|
||||
}
|
||||
if ((hp = gethostbyname(host)) == 0)
|
||||
if ((hp = gethostbyname(host)) == 0 && first_dot != 0)
|
||||
{
|
||||
sprintf(ebuf, "gethostbyname() failed: %s", strerror(errno));
|
||||
*first_dot = '.';
|
||||
hp = gethostbyname(host);
|
||||
}
|
||||
if (hp == 0)
|
||||
{
|
||||
sprintf(ebuf, "gethostbyname('%s') failed: %s", host, strerror(errno));
|
||||
gdomap_log(LOG_ERR);
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue