mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-02-21 14:24:09 +01:00
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>
This commit is contained in:
parent
00a874d4a4
commit
736a80db08
6 changed files with 18 additions and 4 deletions
|
@ -1,3 +1,3 @@
|
|||
CCAN imported from http://ccodearchive.net.
|
||||
|
||||
CCAN version: init-2398-g7082f7d0
|
||||
CCAN version: init-2401-ge2d15a2b
|
||||
|
|
|
@ -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];
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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…
Add table
Reference in a new issue