Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions ccan/README
Original file line number Diff line number Diff line change
@@ -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
13 changes: 12 additions & 1 deletion ccan/ccan/io/poll.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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);
}
}
Expand Down
Loading