소스 검색

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 년 전
부모
커밋
fbcb2f9e71
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  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 */
 #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 */)
                               struct mg_connection *conn /* may be null */)
 {
 {
 	(void)conn; /* Unused. */
 	(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)
 int mg_start_thread(mg_thread_func_t f, void *p)