diff options
| author | bitflash-maintainer <noreply@bitflash.invalid> | 2026-09-02 16:42:39 +0000 |
|---|---|---|
| committer | bitflash-maintainer <noreply@bitflash.invalid> | 2026-09-02 16:42:39 +0000 |
| commit | 456b3b4a3372e7d13b764f41006bf2c15d92f46e (patch) | |
| tree | 25da7616af981f48625a931faeaaa9903fd519f0 /src/db.cpp | |
| parent | 123ae2e017d90fd18b291db3d76033781c1ead84 (diff) | |
log: stop a failed debug.log roll from repeating on every line
Neither remove() nor rename() was checked. When the rename fails -- a
read-only mount, permissions, EXDEV across a bind mount -- fopen() reopens
the same oversized file and writes the "grew past N MB" marker anyway. The
size never drops, so the next line takes the same branch, and every line
after that: the roll's own failure notice becomes unbounded growth, added
to the growth of issue #34 rather than replacing it.
Check rename(), and on failure latch the roll off for the rest of the run
after reporting it once -- on stderr as well as in the log, since whatever
blocked the rename may equally block the log write. An operator is told the
cap has stopped being enforced instead of learning it from the disk.
Diffstat (limited to 'src/db.cpp')
0 files changed, 0 insertions, 0 deletions