Thread (48 messages) flat view 48 messages, 3 authors, 2016-06-15

Re: [PATCH/RFC 01/11] mingw: add network-wrappers for daemon

From: Martin Storsjö <hidden>
Date: 2016-06-15 22:47:46

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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help