소스 검색

casted argument from sizeof to socklen_t

Saumitra Vikram 8 년 전
부모
커밋
87e8499b9e
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 2 2
      src/civetweb.c

+ 2 - 2
src/civetweb.c

@@ -11915,8 +11915,8 @@ close_socket_gracefully(struct mg_connection *conn)
 	 * ephemeral port exhaust problem under high QPS. */
 	linger.l_onoff = 1;
 	linger.l_linger = 1;
-	int error_code=0;
-	getsockopt(conn->client.sock, SOL_SOCKET, SO_ERROR, &error_code, sizeof(error_code));
+	socklen_t error_code=0;
+	getsockopt(conn->client.sock, SOL_SOCKET, SO_ERROR, &error_code, (socklen_t *)sizeof(error_code));
 	if (error_code==ECONNRESET) {
 		/* Socket already closed by client/peer, close socket without linger */
 	}