mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-31 00:30:53 +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
737f6b7e57
commit
5b959ce857
2 changed files with 11 additions and 4 deletions
|
@ -3,6 +3,8 @@
|
||||||
* Source/NSDateFormatter.m:
|
* Source/NSDateFormatter.m:
|
||||||
* Source/NSNumberFormatter.m:
|
* Source/NSNumberFormatter.m:
|
||||||
Tolerate being given null pointers to return values in.
|
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>
|
2004-09-13 Adrian Robert <arobert@cogsci.ucsd.edu>
|
||||||
|
|
||||||
|
|
|
@ -3971,8 +3971,8 @@ donames(const char *host)
|
||||||
unsigned short num = 0;
|
unsigned short num = 0;
|
||||||
int rval;
|
int rval;
|
||||||
uptr b;
|
uptr b;
|
||||||
char *first_dot;
|
char *first_dot = 0;
|
||||||
char *local_hostname=NULL;
|
char *local_hostname = NULL;
|
||||||
|
|
||||||
#if GDOMAP_PORT_OVERRIDE
|
#if GDOMAP_PORT_OVERRIDE
|
||||||
p = htons(GDOMAP_PORT_OVERRIDE);
|
p = htons(GDOMAP_PORT_OVERRIDE);
|
||||||
|
@ -4007,9 +4007,14 @@ donames(const char *host)
|
||||||
}
|
}
|
||||||
host = local_hostname;
|
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);
|
gdomap_log(LOG_ERR);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue