Browse Source

channeld: handle signals during select().

We're about to add SIGUSR1, don't get upset if it happens.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
ppa-0.6.1
Rusty Russell 7 years ago
parent
commit
00a874d4a4
  1. 6
      channeld/channel.c

6
channeld/channel.c

@ -2653,9 +2653,13 @@ int main(int argc, char *argv[])
} else } else
wptr = NULL; wptr = NULL;
if (select(nfds, &rfds, wptr, NULL, tptr) < 0) if (select(nfds, &rfds, wptr, NULL, tptr) < 0) {
/* Signals OK, eg. SIGUSR1 */
if (errno == EINTR)
continue;
status_failed(STATUS_FAIL_INTERNAL_ERROR, status_failed(STATUS_FAIL_INTERNAL_ERROR,
"select failed: %s", strerror(errno)); "select failed: %s", strerror(errno));
}
/* Try writing out encrypted packet if any (don't block!) */ /* Try writing out encrypted packet if any (don't block!) */
if (wptr && FD_ISSET(PEER_FD, wptr)) { if (wptr && FD_ISSET(PEER_FD, wptr)) {

Loading…
Cancel
Save