mirror of
https://github.com/ElementsProject/lightning.git
synced 2024-11-19 09:54:16 +01:00
lightningd: print out what errno we got if unexpected in sigchild.
Looking at #4575, I'm not sure what happened. This prints it out, at least. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
parent
8f33f46960
commit
85562db432
@ -713,8 +713,13 @@ static void on_sigchild(int _ UNUSED)
|
||||
* there are no more children. But glibc's overzealous use of
|
||||
* __attribute__((warn_unused_result)) means we have to
|
||||
* "catch" the return value. */
|
||||
if (write(sigchld_wfd, "", 1) != 1)
|
||||
assert(errno == EAGAIN || errno == EWOULDBLOCK);
|
||||
if (write(sigchld_wfd, "", 1) != 1) {
|
||||
if (errno != EAGAIN && errno == EWOULDBLOCK) {
|
||||
/* Should not call this in a signal handler, but we're
|
||||
* already messed up! */
|
||||
fatal("on_sigchild: write errno %s", strerror(errno));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*~ We only need to handle SIGTERM and SIGINT for the case we are PID 1 of
|
||||
|
Loading…
Reference in New Issue
Block a user