_ws_gethostbyname() and WSAAsyncGetHostByName() when called with a

null name, should use the name returned by gethostname().
This commit is contained in:
Rein Klazes 2003-09-02 18:12:20 +00:00 committed by Alexandre Julliard
parent 9c771e7069
commit 3a35544dd9
2 changed files with 20 additions and 0 deletions

View File

@ -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) {

View File

@ -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) {