mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 15:14:23 +01:00
lightning-cli: don't consume 100% CPU if lightningd crashes.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
@@ -572,7 +572,7 @@ static void enable_notifications(int fd)
|
|||||||
memset(rbuf, 0, sizeof(rbuf));
|
memset(rbuf, 0, sizeof(rbuf));
|
||||||
while (!strends(rbuf, "\n\n")) {
|
while (!strends(rbuf, "\n\n")) {
|
||||||
size_t len = strlen(rbuf);
|
size_t len = strlen(rbuf);
|
||||||
if (cli_read(fd, rbuf + len, sizeof(rbuf) - len) < 0)
|
if (cli_read(fd, rbuf + len, sizeof(rbuf) - len) <= 0)
|
||||||
err(ERROR_TALKING_TO_LIGHTNINGD,
|
err(ERROR_TALKING_TO_LIGHTNINGD,
|
||||||
"Reading enable response");
|
"Reading enable response");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user