[fifolog] wrap the recno when we hit the end of the provided file size.
Without this the log just keeps growing to infinity. Reviewed by: phk Differential Revision: https://reviews.freebsd.org/D25478
This commit is contained in:
parent
5211c24ddf
commit
016bac89db
@ -239,6 +239,14 @@ fifolog_write_output(struct fifolog_writer *f, int fl, time_t now)
|
||||
*/
|
||||
f->seq++;
|
||||
f->recno++;
|
||||
|
||||
/*
|
||||
* Ensure we wrap recno once we hit the file size (in records.)
|
||||
*/
|
||||
if (f->recno >= f->ff->logsize)
|
||||
/* recno 0 is header; skip */
|
||||
f->recno = 1;
|
||||
|
||||
f->flag = 0;
|
||||
|
||||
memset(f->obuf, 0, f->obufsize);
|
||||
|
Loading…
Reference in New Issue
Block a user