diff --git a/common/dev_disconnect.c b/common/dev_disconnect.c index 0b278a13d..f507b332e 100644 --- a/common/dev_disconnect.c +++ b/common/dev_disconnect.c @@ -29,7 +29,9 @@ static void next_dev_disconnect(void) dev_disconnect_line, sizeof(dev_disconnect_line)-1); if (r < 0) err(1, "Reading dev_disconnect file"); - lseek(dev_disconnect_fd, -r, SEEK_CUR); + if (lseek(dev_disconnect_fd, -r, SEEK_CUR) < 0) { + err(1, "lseek failure"); + } /* Get first line */ dev_disconnect_line[r] = '\n'; @@ -74,7 +76,9 @@ enum dev_disconnect dev_disconnect(int pkt_type) return DEV_DISCONNECT_NORMAL; } - lseek(dev_disconnect_fd, dev_disconnect_len+1, SEEK_CUR); + if (lseek(dev_disconnect_fd, dev_disconnect_len+1, SEEK_CUR) < 0) { + err(1, "lseek failure"); + } status_trace("dev_disconnect: %s%s", dev_disconnect_line, dev_disconnect_nocommit ? "-nocommit" : ""); diff --git a/lightningd/subd.c b/lightningd/subd.c index 681e594d4..e67415ff5 100644 --- a/lightningd/subd.c +++ b/lightningd/subd.c @@ -776,7 +776,9 @@ bool dev_disconnect_permanent(struct lightningd *ld) return true; /* Nope, restore. */ - lseek(ld->dev_disconnect_fd, -r, SEEK_CUR); + if (lseek(ld->dev_disconnect_fd, -r, SEEK_CUR) < 0) { + fatal("lseek failure"); + } return false; } #endif /* DEVELOPER */