Skip to content

Commit

Permalink
Fixed problem on Windows build
Browse files Browse the repository at this point in the history
  • Loading branch information
Ake Hedman committed Aug 22, 2018
1 parent 081f6f2 commit db7cdd3
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/common/sockettcp.c
Expand Up @@ -1036,7 +1036,7 @@ event_destroy(void *eventhdl)
static void
set_close_on_exec(SOCKET sock)
{
(void)conn; // Unused.
(void)sock; // Unused.
}


Expand Down Expand Up @@ -2840,6 +2840,8 @@ stcp_close_connection( struct stcp_connection *conn )
* @return >0 success, -1 timeout, -2 stopped
*/

#ifndef _WIN32

int
stcp_poll( struct pollfd *pfd,
unsigned int n,
Expand Down Expand Up @@ -2888,6 +2890,8 @@ stcp_poll( struct pollfd *pfd,
return 0;
}

#endif

////////////////////////////////////////////////////////////////////////////////
// stcp_push_inner
//
Expand Down Expand Up @@ -3798,7 +3802,7 @@ stcp_listening( struct server_context *srv_ctx,
// same process, so a short Sleep may be
// required between web_stop and web_start.
//
if ( setsockopt( srv_ctx->listener.sock,
if ( setsockopt(so.sock,
SOL_SOCKET,
SO_EXCLUSIVEADDRUSE,
(SOCK_OPT_TYPE) & on,
Expand Down Expand Up @@ -4002,7 +4006,7 @@ stcp_accept( struct server_context *srv_ctx,

// Put so socket structure into the queue
#if defined(_WIN32)
(void)SetHandleInformation((HANDLE)(intptr_t)so.sock, HANDLE_FLAG_INHERIT, 0);
(void)SetHandleInformation((HANDLE)(intptr_t)psocket->sock, HANDLE_FLAG_INHERIT, 0);
#else
if ( fcntl( psocket->sock, F_SETFD, FD_CLOEXEC ) != 0 ) {
// Failed TODO
Expand Down

0 comments on commit db7cdd3

Please sign in to comment.