[mod_logfile] Continue renaming if a logfile doesn't exist

this prevents a scenario where freeswitch.log fails to get rotated and eventually fills up the hard drive causing a crash. See issue #1738
This commit is contained in:
Royce Mitchell 2022-11-01 11:19:15 -05:00 committed by GitHub
parent 6184eb5ffd
commit 1213217ccc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -163,7 +163,9 @@ static switch_status_t mod_logfile_rotate(logfile_profile_t *profile)
if ((status = switch_file_rename(from_filename, to_filename, pool)) != SWITCH_STATUS_SUCCESS) { if ((status = switch_file_rename(from_filename, to_filename, pool)) != SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Error renaming log from %s to %s [%s]\n", switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Error renaming log from %s to %s [%s]\n",
from_filename, to_filename, strerror(errno)); from_filename, to_filename, strerror(errno));
goto end; if (errno != ENOENT) {
goto end;
}
} }
} }