bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: gethostname, socket need startup code


From: Paolo Bonzini
Subject: Re: gethostname, socket need startup code
Date: Sun, 02 Aug 2009 16:59:39 +0200
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1b3pre) Gecko/20090513 Fedora/3.0-2.3.beta2.fc11 Lightning/1.0pre Thunderbird/3.0b2

On 08/02/2009 04:45 PM, Bruno Haible wrote:
Hi Simon,

On mingw, the gethostname test fails for me:

   gethostname failed, rc -1 errno 10093
   FAIL: test-gethostname.exe

The reason is that the WSAStartup function has not been called. Why not make
this initialization implicitly in the gethostname function? And likewise for
the socket() function? With that, the unit tests (test-select.c and test-poll.c)
don't need to do this initialization explicitly any more. One less portability
problem when porting to mingw.

Here are two proposed patches. I verified that the behaviour of test-select
and test-poll does not change, and it fixes the gethostname failure.

I'm wondering if some programs out there used WSAStartup autonomously without going through the sockets module...

Paolo




reply via email to

[Prev in Thread] Current Thread [Next in Thread]