Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 13 additions & 12 deletions core/iwasm/libraries/lib-socket/src/wasi/wasi_socket_ext.c
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,9 @@ accept(int sockfd, struct sockaddr *addr, socklen_t *addrlen)
error = __wasi_sock_accept(sockfd, 0, &new_sockfd);
HANDLE_ERROR(error)

error = getpeername(new_sockfd, addr, addrlen);
HANDLE_ERROR(error)
if (getpeername(new_sockfd, addr, addrlen) == -1) {
return -1;
}

return new_sockfd;
}
Expand Down Expand Up @@ -543,7 +544,7 @@ freeaddrinfo(struct addrinfo *res)
free(res);
}

struct timeval
static struct timeval
time_us_to_timeval(uint64_t time_us)
{
struct timeval tv;
Expand All @@ -552,13 +553,13 @@ time_us_to_timeval(uint64_t time_us)
return tv;
}

uint64_t
static uint64_t
timeval_to_time_us(struct timeval tv)
{
return (tv.tv_sec * 1000000UL) + tv.tv_usec;
}

int
static int
get_sol_socket_option(int sockfd, int optname, void *__restrict optval,
socklen_t *__restrict optlen)
{
Expand Down Expand Up @@ -625,7 +626,7 @@ get_sol_socket_option(int sockfd, int optname, void *__restrict optval,
}
}

int
static int
get_ipproto_tcp_option(int sockfd, int optname, void *__restrict optval,
socklen_t *__restrict optlen)
{
Expand Down Expand Up @@ -664,7 +665,7 @@ get_ipproto_tcp_option(int sockfd, int optname, void *__restrict optval,
}
}

int
static int
get_ipproto_ip_option(int sockfd, int optname, void *__restrict optval,
socklen_t *__restrict optlen)
{
Expand Down Expand Up @@ -694,7 +695,7 @@ get_ipproto_ip_option(int sockfd, int optname, void *__restrict optval,
}
}

int
static int
get_ipproto_ipv6_option(int sockfd, int optname, void *__restrict optval,
socklen_t *__restrict optlen)
{
Expand Down Expand Up @@ -741,7 +742,7 @@ getsockopt(int sockfd, int level, int optname, void *__restrict optval,
}
}

int
static int
set_sol_socket_option(int sockfd, int optname, const void *optval,
socklen_t optlen)
{
Expand Down Expand Up @@ -805,7 +806,7 @@ set_sol_socket_option(int sockfd, int optname, const void *optval,
}
}

int
static int
set_ipproto_tcp_option(int sockfd, int optname, const void *optval,
socklen_t optlen)
{
Expand Down Expand Up @@ -845,7 +846,7 @@ set_ipproto_tcp_option(int sockfd, int optname, const void *optval,
}
}

int
static int
set_ipproto_ip_option(int sockfd, int optname, const void *optval,
socklen_t optlen)
{
Expand Down Expand Up @@ -898,7 +899,7 @@ set_ipproto_ip_option(int sockfd, int optname, const void *optval,
}
}

int
static int
set_ipproto_ipv6_option(int sockfd, int optname, const void *optval,
socklen_t optlen)
{
Expand Down