From d9a090d4784200a09067fb895d8aaf1ab945cdc0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?N=C3=ADckolas=20Goline?= Date: Thu, 18 Jun 2026 15:24:47 -0300 Subject: [PATCH 1/2] makefile: update: update-ccan Update update-ccan recipe to use ccan's commit instead of tag since ccan's home moved to github Changelog-None --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 72c8d7757647..b12567e1ea82 100644 --- a/Makefile +++ b/Makefile @@ -825,7 +825,7 @@ update-ccan: cp ../ccan/tools/configurator/configurator.c ../ccan/doc/configurator.1 ccan/tools/configurator/ $(MAKE) ccan/config.h grep -v '^CCAN version:' ccan.old/README > ccan/README - echo CCAN version: `git -C ../ccan describe` >> ccan/README + echo CCAN version: `git -C ../ccan rev-parse --short HEAD` >> ccan/README $(RM) -r ccan.old $(RM) -r ccan/ccan/hash/ ccan/ccan/tal/talloc/ # Unnecessary deps From fb933640c7217f35bc4e6197bafbd63bf39ea066 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?N=C3=ADckolas=20Goline?= Date: Thu, 18 Jun 2026 15:26:49 -0300 Subject: [PATCH 2/2] ccan: update ccan to efd48386 - readme: remove reference to old domain and point to rustyrussell/ccan --- ccan/README | 4 ++-- ccan/ccan/io/poll.c | 13 ++++++++++++- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/ccan/README b/ccan/README index 6dd49e6445ee..8d518c240daa 100644 --- a/ccan/README +++ b/ccan/README @@ -1,3 +1,3 @@ -CCAN imported from http://ccodearchive.net. +CCAN imported from https://github.com/rustyrussell/ccan. -CCAN version: init-2612-ge242779f +CCAN version: efd48386 diff --git a/ccan/ccan/io/poll.c b/ccan/ccan/io/poll.c index 656cc0e3a33c..c4cbaee85678 100644 --- a/ccan/ccan/io/poll.c +++ b/ccan/ccan/io/poll.c @@ -433,6 +433,7 @@ void *io_loop(struct timers *timers, struct timer **expired) fairness_counter++; for (size_t rotation = 0; rotation < num_fds && !io_loop_return; rotation++) { + socklen_t errno_len = sizeof(errno); struct io_conn *c; int events; @@ -469,8 +470,18 @@ void *io_loop(struct timers *timers, struct timer **expired) r--; io_ready(c, events); } else if (events & (POLLHUP|POLLNVAL|POLLERR)) { + /* On `connect` failure, Linux typically + * returns POLLIN|POLLERR. MacOS returns either + * POLLHUP|POLLERR or POLLOUT|POLLHUP depending + * on version, setting the socket error to + * ECONNREFUSED. */ r--; - errno = EBADF; + /* Get fd's specific error to find Mac's + * ECONNREFUSED, among others */ + if(getsockopt(fds[i]->fd, SOL_SOCKET, SO_ERROR, + &errno, &errno_len) == -1) { + errno = EBADF; + } io_close(c); } }