From 91c2345d42459232d958eaf0eba5b10786ac3475 Mon Sep 17 00:00:00 2001 From: Ali Mohammad Pur Date: Fri, 9 Jul 2021 04:59:05 +0430 Subject: [PATCH 4/7] tcp: Don't use SO_LINGER --- src/unix/tcp.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/unix/tcp.c b/src/unix/tcp.c index bc0fb66..e78259a 100644 --- a/src/unix/tcp.c +++ b/src/unix/tcp.c @@ -313,15 +313,19 @@ int uv_tcp_getpeername(const uv_tcp_t* handle, int uv_tcp_close_reset(uv_tcp_t* handle, uv_close_cb close_cb) { int fd; +#ifndef __serenity__ struct linger l = { 1, 0 }; +#endif /* Disallow setting SO_LINGER to zero due to some platform inconsistencies */ if (handle->flags & UV_HANDLE_SHUTTING) return UV_EINVAL; fd = uv__stream_fd(handle); +#ifndef __serenity__ if (0 != setsockopt(fd, SOL_SOCKET, SO_LINGER, &l, sizeof(l))) return UV__ERR(errno); +#endif uv_close((uv_handle_t*) handle, close_cb); return 0; -- 2.32.0