|
|
@ -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 */ |
|
|
|