Skip to content

Commit

Permalink
Move net_close to Linux-only portion of code
Browse files Browse the repository at this point in the history
  • Loading branch information
dmaivel committed May 27, 2024
1 parent 3f4ef78 commit 1e4540b
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/network/net.c
Original file line number Diff line number Diff line change
Expand Up @@ -259,19 +259,15 @@ bool net_did_event_happen_here(struct net_context *ctx, int fd)
{
return ctx->in_use[fd] && ctx->fds[fd].revents & POLLIN;
}
#endif

void net_close(struct net_context *ctx, int fd)
{
ctx->in_use[fd] = false;
ctx->fds[fd].revents = 0;
ctx->fds[fd].fd = -1;
#ifdef _WIN32
closesocket(ctx->fds[fd].fd);
#else
close(ctx->fds[fd].fd);
#endif
}
#endif

// void net_goodbye(struct net_context *ctx)
// {
Expand Down

0 comments on commit 1e4540b

Please sign in to comment.