diff --git a/channeld/channeld.c b/channeld/channeld.c index c4f2a744d..f701d24aa 100644 --- a/channeld/channeld.c +++ b/channeld/channeld.c @@ -955,6 +955,10 @@ static void send_shutdown_complete(struct peer *peer) wire_sync_write(MASTER_FD, take(towire_channeld_shutdown_complete(NULL))); per_peer_state_fdpass_send(MASTER_FD, peer->pps); + + /* Give master a chance to pass the fd along */ + sleep(1); + close(MASTER_FD); } diff --git a/openingd/dualopend.c b/openingd/dualopend.c index 03e47911c..e215cca18 100644 --- a/openingd/dualopend.c +++ b/openingd/dualopend.c @@ -303,6 +303,9 @@ static void dualopen_shutdown(struct state *state) status_debug("Sent %s with fds", dualopend_wire_name(fromwire_peektype(msg))); + /* Give master a chance to pass the fd along */ + sleep(1); + /* This frees the entire tal tree. */ tal_free(state); daemon_shutdown(); @@ -3989,6 +3992,9 @@ int main(int argc, char *argv[]) dualopend_wire_name(fromwire_peektype(msg))); tal_free(msg); + /* Give master a chance to pass the fd along */ + sleep(1); + /* This frees the entire tal tree. */ tal_free(state); daemon_shutdown(); diff --git a/openingd/openingd.c b/openingd/openingd.c index 3e9272a43..a7bd167f5 100644 --- a/openingd/openingd.c +++ b/openingd/openingd.c @@ -1485,6 +1485,9 @@ int main(int argc, char *argv[]) status_debug("Sent %s with fd", openingd_wire_name(fromwire_peektype(msg))); + /* Give master a chance to pass the fd along */ + sleep(1); + /* This frees the entire tal tree. */ tal_free(state);