Fixed reset LR pointers in empty message areas.
This commit is contained in:
10
lib/jammsg.c
10
lib/jammsg.c
@@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
Reference in New Issue
Block a user