Browse Source

【主线待合】解决上一条中所述的日志问题

paint_robot_new-v1.5
Lizongdi 2 weeks ago
parent
commit
81b9ca8d0e
  1. 2
      library/log/elog_file.c

2
library/log/elog_file.c

@ -85,7 +85,7 @@ static bool elog_file_rotate(void)
fp = NULL; fp = NULL;
for (n = local_cfg.max_rotate - 1; n >= 0; --n) { for (n = local_cfg.max_rotate - 1; n >= 0; --n) {
RD_SNPRINTF(oldpath + base, SUFFIX_LEN, n ? ".%d" : "", n - 1); RD_SNPRINTF(oldpath + base, SUFFIX_LEN, n ? ".%04d" : "", n - 1);
if (n > 9999) n = 9999; if (n > 9999) n = 9999;
RD_SNPRINTF(newpath + base, SUFFIX_LEN, ".%04d", n); RD_SNPRINTF(newpath + base, SUFFIX_LEN, ".%04d", n);
/* remove the old file */ /* remove the old file */

Loading…
Cancel
Save