Fixed reset LR pointers in empty message areas.

This commit is contained in:
Michiel Broek
2004-07-08 19:33:00 +00:00
parent 053182b875
commit 8b152e4960
3 changed files with 12 additions and 8 deletions

View File

@@ -709,12 +709,18 @@ void JAM_Pack(void)
}
/*
* Now copy the lastread file
* Now copy the lastread file, reset LastRead pointers if area is empty.
*/
lseek(fdJlr, 0, SEEK_SET);
for (i = 0; i < count; i++) {
if (read(fdJlr, &LR, sizeof(lastread)) == sizeof(lastread))
if (read(fdJlr, &LR, sizeof(lastread)) == sizeof(lastread)) {
if (jamHdrInfo.ActiveMsgs == 0 && (LR.LastReadMsg || LR.HighReadMsg)) {
Syslog('-', "jamPack: reset LR pointer index %d, area %s", i, BaseName);
LR.LastReadMsg = 0;
LR.HighReadMsg = 0;
}
write(fdnJlr, &LR, sizeof(lastread));
}
}
/*