_ws_gethostbyname() and WSAAsyncGetHostByName() when called with a
null name, should use the name returned by gethostname().
This commit is contained in:
parent
9c771e7069
commit
3a35544dd9
|
@ -402,6 +402,16 @@ static DWORD WINAPI _async_queryfun(LPVOID arg) {
|
||||||
int ebufsize=1024;
|
int ebufsize=1024;
|
||||||
struct hostent hostentry;
|
struct hostent hostentry;
|
||||||
int locerr = ENOBUFS;
|
int locerr = ENOBUFS;
|
||||||
|
#endif
|
||||||
|
char buf[100];
|
||||||
|
if( !(aq->host_name)) {
|
||||||
|
aq->host_name = buf;
|
||||||
|
if( gethostname( buf, 100) == -1) {
|
||||||
|
fail = WSAENOBUFS; /* appropriate ? */
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#ifdef HAVE_LINUX_GETHOSTBYNAME_R_6
|
||||||
he = NULL;
|
he = NULL;
|
||||||
extrabuf=HeapAlloc(GetProcessHeap(),0,ebufsize) ;
|
extrabuf=HeapAlloc(GetProcessHeap(),0,ebufsize) ;
|
||||||
while(extrabuf) {
|
while(extrabuf) {
|
||||||
|
|
|
@ -2903,6 +2903,16 @@ static WIN_hostent * __ws_gethostbyname(const char *name, int dup_flag)
|
||||||
int ebufsize=1024;
|
int ebufsize=1024;
|
||||||
struct hostent hostentry;
|
struct hostent hostentry;
|
||||||
int locerr = ENOBUFS;
|
int locerr = ENOBUFS;
|
||||||
|
#endif
|
||||||
|
char buf[100];
|
||||||
|
if( !name) {
|
||||||
|
name = buf;
|
||||||
|
if( gethostname( buf, 100) == -1) {
|
||||||
|
SetLastError( WSAENOBUFS); /* appropriate ? */
|
||||||
|
return retval;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#ifdef HAVE_LINUX_GETHOSTBYNAME_R_6
|
||||||
host = NULL;
|
host = NULL;
|
||||||
extrabuf=HeapAlloc(GetProcessHeap(),0,ebufsize) ;
|
extrabuf=HeapAlloc(GetProcessHeap(),0,ebufsize) ;
|
||||||
while(extrabuf) {
|
while(extrabuf) {
|
||||||
|
|
Loading…
Reference in New Issue