gethostbyname patch

Shachar Shemesh wine-devel at shemesh.biz
Tue May 6 09:15:20 CDT 2003


Andreas Mohr wrote:

>Hi all,
>
>http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winsock/winsock/gethostbyname_2.asp
>
>says that if name is NULL, it should retrieve information for the
>local hostname.
>
>
>Index: dlls/winsock/socket.c
>===================================================================
>RCS file: /home/wine/wine/dlls/winsock/socket.c,v
>retrieving revision 1.125
>diff -u -r1.125 socket.c
>--- dlls/winsock/socket.c	9 Apr 2003 23:33:35 -0000	1.125
>+++ dlls/winsock/socket.c	6 May 2003 13:43:08 -0000
>@@ -3038,6 +3038,17 @@
>     int ebufsize=1024;
>     struct hostent hostentry;
>     int locerr = ENOBUFS;
>+    char local_name[256];
>+
>+    /* name == NULL means use the local host name */
>+    if (name == NULL)
>+    {
>+	if (WS_gethostname(local_name, sizeof(local_name)) != 0)
>+		FIXME("failed to get local host name, please report!\n");
>
Why is that a FIXME? Shouldn't a "ERR" work better here?

>+		
>+	name = local_name;
>+    }
>+    
>     host = NULL;
>     extrabuf=HeapAlloc(GetProcessHeap(),0,ebufsize) ;
>     while(extrabuf) {
>
>  
>


-- 
Shachar Shemesh
Open Source integration consultant
Home page & resume - http://www.shemesh.biz/





More information about the wine-devel mailing list