Commit 3a35544d authored by Rein Klazes's avatar Rein Klazes Committed by Alexandre Julliard

_ws_gethostbyname() and WSAAsyncGetHostByName() when called with a

null name, should use the name returned by gethostname().
parent 9c771e70
......@@ -402,6 +402,16 @@ static DWORD WINAPI _async_queryfun(LPVOID arg) {
int ebufsize=1024;
struct hostent hostentry;
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;
extrabuf=HeapAlloc(GetProcessHeap(),0,ebufsize) ;
while(extrabuf) {
......
......@@ -2903,6 +2903,16 @@ static WIN_hostent * __ws_gethostbyname(const char *name, int dup_flag)
int ebufsize=1024;
struct hostent hostentry;
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;
extrabuf=HeapAlloc(GetProcessHeap(),0,ebufsize) ;
while(extrabuf) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment