lightning-cli: don't consume 100% CPU if lightningd crashes.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell 2022-09-12 09:42:32 +09:30
parent 88354b79bd
commit 6c07f1365f

View file

@ -572,7 +572,7 @@ static void enable_notifications(int fd)
memset(rbuf, 0, sizeof(rbuf));
while (!strends(rbuf, "\n\n")) {
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,
"Reading enable response");
}