mirror of
https://github.com/aljazceru/lightning.git
synced 2026-02-02 20:54:23 +01:00
dev_disconnect: don't permfail more than once.
The coming tests trigger this latent bug under travis. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
committed by
Christian Decker
parent
ebba5f85a2
commit
f83ee6d5ea
@@ -645,7 +645,11 @@ bool dev_disconnect_permanent(struct lightningd *ld)
|
||||
r = read(ld->dev_disconnect_fd, permfail, sizeof(permfail));
|
||||
if (r < 0)
|
||||
fatal("Reading dev_disconnect file: %s", strerror(errno));
|
||||
lseek(ld->dev_disconnect_fd, -r, SEEK_CUR);
|
||||
|
||||
return memeq(permfail, r, "permfail", strlen("permfail"));
|
||||
if (memeq(permfail, r, "permfail", strlen("permfail")))
|
||||
return true;
|
||||
|
||||
/* Nope, restore. */
|
||||
lseek(ld->dev_disconnect_fd, -r, SEEK_CUR);
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user