mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-11-28 19:55:53 +03:00
Fix SO_REUSEPORT issue in linux.
This commit is contained in:
parent
ffe0786f03
commit
91adaea16a
@ -335,12 +335,14 @@ static int uv__bind(uv_udp_t* handle,
|
||||
* None of the above applies to Linux: SO_REUSEADDR implies SO_REUSEPORT on
|
||||
* Linux and hence it does not have SO_REUSEPORT at all.
|
||||
*/
|
||||
#ifndef __linux__
|
||||
#ifdef SO_REUSEPORT
|
||||
yes = 1;
|
||||
if (setsockopt(fd, SOL_SOCKET, SO_REUSEPORT, &yes, sizeof yes) == -1) {
|
||||
uv__set_sys_error(handle->loop, errno);
|
||||
goto out;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
if (flags & UV_UDP_IPV6ONLY) {
|
||||
|
4
v/ames.c
4
v/ames.c
@ -298,7 +298,7 @@ u2_ames_io_init()
|
||||
u2z(num);
|
||||
}
|
||||
|
||||
if ( 0 != uv_udp_init(u2L, &sam_u->wax_u) ) {
|
||||
if ( 0 != uv_udp_init(u2L, &u2_Host.sam_u.wax_u) ) {
|
||||
uL(fprintf(uH, "ames: init: %s\n", uv_strerror(uv_last_error(u2L))));
|
||||
c3_assert(0);
|
||||
}
|
||||
@ -314,7 +314,7 @@ u2_ames_io_init()
|
||||
add_u.sin_port = htons(por_s);
|
||||
|
||||
if ( uv_udp_bind(&sam_u->wax_u, add_u, 0) != 0 ) {
|
||||
uL(fprintf(uH, "ames: init: %s\n",
|
||||
uL(fprintf(uH, "ames: bind: %s\n",
|
||||
uv_strerror(uv_last_error(u2L))));
|
||||
c3_assert(0);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user