Browse Source

Make the set_close_on_exec shim cross-platform

The declartion of the set_close_on_exec function has different
signatures on Windows and non-Windows platforms. This makes them
the same. Solves some casting issues.
Matt Clarkson 10 years ago
parent
commit
fbcb2f9e71
1 changed files with 2 additions and 2 deletions
  1. 2 2
      src/civetweb.c

+ 2 - 2
src/civetweb.c

@@ -2512,11 +2512,11 @@ static int poll(struct pollfd *pfd, unsigned int n, int milliseconds)
 }
 #endif /* HAVE_POLL */
 
-static void set_close_on_exec(SOCKET sock,
+static void set_close_on_exec(int sock,
                               struct mg_connection *conn /* may be null */)
 {
 	(void)conn; /* Unused. */
-	(void)SetHandleInformation((HANDLE)sock, HANDLE_FLAG_INHERIT, 0);
+	(void)SetHandleInformation((HANDLE)(intptr_t)sock, HANDLE_FLAG_INHERIT, 0);
 }
 
 int mg_start_thread(mg_thread_func_t f, void *p)