Browse Source

ccan: update so ccan/io doesn't exit when we get signals.

In particular, we're going to capture SIGUSR1.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
ppa-0.6.1
Rusty Russell 7 years ago
parent
commit
736a80db08
  1. 2
      ccan/README
  2. 7
      ccan/ccan/io/poll.c
  3. 2
      ccan/ccan/opt/usage.c
  4. 2
      ccan/ccan/tal/path/path.c
  5. 7
      ccan/ccan/tal/path/test/run-join.c
  6. 2
      ccan/tools/configurator/configurator.c

2
ccan/README

@ -1,3 +1,3 @@
CCAN imported from http://ccodearchive.net.
CCAN version: init-2398-g7082f7d0
CCAN version: init-2401-ge2d15a2b

7
ccan/ccan/io/poll.c

@ -280,8 +280,13 @@ void *io_loop(struct timers *timers, struct timer **expired)
}
r = pollfn(pollfds, num_fds, ms_timeout);
if (r < 0)
if (r < 0) {
/* Signals shouldn't break us, unless they set
* io_loop_return. */
if (errno == EINTR)
continue;
break;
}
for (i = 0; i < num_fds && !io_loop_return; i++) {
struct io_conn *c = (void *)fds[i];

2
ccan/ccan/opt/usage.c

@ -4,7 +4,9 @@
#include <sys/ioctl.h>
#include <sys/termios.h> /* Required on Solaris for struct winsize */
#endif
#if HAVE_SYS_UNISTD_H
#include <sys/unistd.h> /* Required on Solaris for ioctl */
#endif
#include <string.h>
#include <stdlib.h>
#include <stdio.h>

2
ccan/ccan/tal/path/path.c

@ -52,7 +52,7 @@ char *path_join(const tal_t *ctx, const char *base, const char *a)
ret = tal_dup_arr(ctx, char, base, len, 1 + strlen(a) + 1);
if (!ret)
goto out;
if (ret[len-1] != PATH_SEP)
if (len != 0 && ret[len-1] != PATH_SEP)
ret[len++] = PATH_SEP;
strcpy(ret + len, a);

7
ccan/ccan/tal/path/test/run-join.c

@ -6,7 +6,7 @@ int main(void)
{
char *path, *ctx = tal_strdup(NULL, "ctx");
plan_tests(34);
plan_tests(36);
path = path_join(ctx, "foo", "bar");
ok1(streq(path, "foo/bar"));
@ -85,6 +85,11 @@ int main(void)
ok1(!path);
ok1(!tal_first(ctx));
path = path_join(ctx, "", "bar");
ok1(streq(path, "bar"));
ok1(tal_parent(path) == ctx);
tal_free(path);
tal_free(ctx);
return exit_status();

2
ccan/tools/configurator/configurator.c

@ -315,6 +315,8 @@ static struct test tests[] = {
"#include <sys/filio.h>\n" },
{ "HAVE_SYS_TERMIOS_H", OUTSIDE_MAIN, NULL, NULL,
"#include <sys/termios.h>\n" },
{ "HAVE_SYS_UNISTD_H", OUTSIDE_MAIN, NULL, NULL,
"#include <sys/unistd.h>\n" },
{ "HAVE_TYPEOF", INSIDE_MAIN, NULL, NULL,
"__typeof__(argc) i; i = argc; return i == argc ? 0 : 1;" },
{ "HAVE_UNALIGNED_ACCESS", DEFINES_EVERYTHING|EXECUTE, NULL, NULL,

Loading…
Cancel
Save