Re: [PATCH/RFC 01/11] mingw: add network-wrappers for daemon
- From
Martin Storsjö <martin@martin.st>
- Date
- Nov 26, 2009, 08:24 UTC
- Message-ID
- <alpine.DEB.2.00.0911261015140.14228@cone.home.martin.st>
- In-Reply-To
- <1259196260-3064-2-git-send-email-kusmabite@gmail.com>
Hi,
First of all, great that you're working on adding daemon support for windows!
On Thu, 26 Nov 2009, Erik Faye-Lund wrote:
Show 14 quoted lines
> +static void wsa_init(void)
> {
> + static int initialized = 0;
> WSADATA wsa;
>
> + if (initialized)
> + return;
> +
> if (WSAStartup(MAKEWORD(2,2), &wsa))
> die("unable to initialize winsock subsystem, error %d",
> WSAGetLastError());
> atexit((void(*)(void)) WSACleanup);
> + initialized = 1;
> +}Something similar to this was merged into master recently as part of my mingw/ipv6 patches, so by rebasing your patch on top of that, this patch will probably get a bit smaller.
Also, the getaddrinfo-compatibility wrappers perhaps may need some minor updates to handle the use cases needed for setting up listening sockets.
// Martin