Skip to content

Commit 8c71917

Browse files
committed
ccan: update ccan to 7c38521d
- readme: remove reference to old domain and point to rustyrussell/ccan
1 parent d9a090d commit 8c71917

3 files changed

Lines changed: 15 additions & 4 deletions

File tree

ccan/README

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
CCAN imported from http://ccodearchive.net.
1+
CCAN imported from https://github.com/rustyrussell/ccan.
22

3-
CCAN version: init-2612-ge242779f
3+
CCAN version: 7c38521d

ccan/ccan/io/poll.c

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -433,6 +433,7 @@ void *io_loop(struct timers *timers, struct timer **expired)
433433

434434
fairness_counter++;
435435
for (size_t rotation = 0; rotation < num_fds && !io_loop_return; rotation++) {
436+
socklen_t errno_len = sizeof(errno);
436437
struct io_conn *c;
437438
int events;
438439

@@ -469,8 +470,18 @@ void *io_loop(struct timers *timers, struct timer **expired)
469470
r--;
470471
io_ready(c, events);
471472
} else if (events & (POLLHUP|POLLNVAL|POLLERR)) {
473+
/* On `connect` failure, Linux typically
474+
* returns POLLIN|POLLERR. MacOS returns either
475+
* POLLHUP|POLLERR or POLLOUT|POLLHUP depending
476+
* on version, setting the socket error to
477+
* ECONNREFUSED. */
472478
r--;
473-
errno = EBADF;
479+
/* Get fd's specific error to find Mac's
480+
* ECONNREFUSED, among others */
481+
if(getsockopt(fds[i]->fd, SOL_SOCKET, SO_ERROR,
482+
&errno, &errno_len) == -1) {
483+
errno = EBADF;
484+
}
474485
io_close(c);
475486
}
476487
}

ccan/ccan/json_out/json_out.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ bool json_out_addstrn(struct json_out *jout,
306306
struct json_escape *e;
307307

308308
if (json_escape_needed(str, len)) {
309-
e = json_escape_len(NULL, str, len);
309+
e = json_escape(NULL, str);
310310
str = e->s;
311311
len = strlen(str);
312312
} else

0 commit comments

Comments
 (0)