From: Martin Storsjö Date: Thu, 26 Nov 2009 08:24:08 GMT Subject: Re: [PATCH/RFC 01/11] mingw: add network-wrappers for daemon Message-ID: 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: > +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