commit:     23f44d403521c1e52c18896fec24cd9a7fbee6a8
Author:     orbea <orbea <AT> riseup <DOT> net>
AuthorDate: Fri Dec 13 03:51:36 2024 +0000
Commit:     orbea <orbea <AT> riseup <DOT> net>
CommitDate: Fri Dec 13 03:51:36 2024 +0000
URL:        https://gitweb.gentoo.org/repo/proj/libressl.git/commit/?id=23f44d40

net-misc/curl: add 8.11.1-r1, drop 8.11.1

Signed-off-by: orbea <orbea <AT> riseup.net>

 .../{curl-8.11.1.ebuild => curl-8.11.1-r1.ebuild}  |  1 +
 .../curl-8.11.1-async-thread-close-eventfd.patch   | 33 ++++++++++++++++++++++
 2 files changed, 34 insertions(+)

diff --git a/net-misc/curl/curl-8.11.1.ebuild 
b/net-misc/curl/curl-8.11.1-r1.ebuild
similarity index 99%
rename from net-misc/curl/curl-8.11.1.ebuild
rename to net-misc/curl/curl-8.11.1-r1.ebuild
index 60486cb..aca6d0d 100644
--- a/net-misc/curl/curl-8.11.1.ebuild
+++ b/net-misc/curl/curl-8.11.1-r1.ebuild
@@ -154,6 +154,7 @@ QA_CONFIG_IMPL_DECL_SKIP=(
 PATCHES=(
        "${FILESDIR}/${PN}-prefix-3.patch"
        "${FILESDIR}/${PN}-respect-cflags-3.patch"
+       "${FILESDIR}/${P}-async-thread-close-eventfd.patch"
 )
 
 src_prepare() {

diff --git a/net-misc/curl/files/curl-8.11.1-async-thread-close-eventfd.patch 
b/net-misc/curl/files/curl-8.11.1-async-thread-close-eventfd.patch
new file mode 100644
index 0000000..2bdfc51
--- /dev/null
+++ b/net-misc/curl/files/curl-8.11.1-async-thread-close-eventfd.patch
@@ -0,0 +1,33 @@
+https://github.com/curl/curl/commit/ff5091aa9f73802e894b1cbdf24ab84e103200e2
+From: Andy Pan <[email protected]>
+Date: Thu, 12 Dec 2024 12:48:56 +0000
+Subject: [PATCH] async-thread: avoid closing eventfd twice
+
+When employing eventfd for socketpair, there is only one file
+descriptor. Closing that fd twice might result in fd corruption.
+Thus, we should avoid closing the eventfd twice, following the
+pattern in lib/multi.c.
+
+Fixes #15725
+Closes #15727
+Reported-by: Christian Heusel
+---
+ lib/asyn-thread.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/lib/asyn-thread.c b/lib/asyn-thread.c
+index a58e4b790494ab..32d496b107cb0a 100644
+--- a/lib/asyn-thread.c
++++ b/lib/asyn-thread.c
+@@ -195,9 +195,11 @@ void destroy_thread_sync_data(struct thread_sync_data 
*tsd)
+    * close one end of the socket pair (may be done in resolver thread);
+    * the other end (for reading) is always closed in the parent thread.
+    */
++#ifndef USE_EVENTFD
+   if(tsd->sock_pair[1] != CURL_SOCKET_BAD) {
+     wakeup_close(tsd->sock_pair[1]);
+   }
++#endif
+ #endif
+   memset(tsd, 0, sizeof(*tsd));
+ }

Reply via email to