1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-25 15:45:08 +00:00
serenity/Ports/libuv/patches/0004-tcp-Don-t-use-SO_LINGER.patch
Ali Mohammad Pur fcd56f2172 Ports: Add libuv
We've had a half-arsed port of libuv inside the cmake port, but let's
just port it properly.
Note that this pins a specific commit (which is currently the latest
commit in their default branch).
2021-07-09 15:36:50 +02:00

36 lines
969 B
Diff

From 91c2345d42459232d958eaf0eba5b10786ac3475 Mon Sep 17 00:00:00 2001
From: Ali Mohammad Pur <ali.mpfard@gmail.com>
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