From 1213217ccc65d1241b04f167bc2e467e65d00a44 Mon Sep 17 00:00:00 2001 From: Royce Mitchell Date: Tue, 1 Nov 2022 11:19:15 -0500 Subject: [PATCH] [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 --- src/mod/loggers/mod_logfile/mod_logfile.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/mod/loggers/mod_logfile/mod_logfile.c b/src/mod/loggers/mod_logfile/mod_logfile.c index 4dc3c6a7e8..877403c5b6 100644 --- a/src/mod/loggers/mod_logfile/mod_logfile.c +++ b/src/mod/loggers/mod_logfile/mod_logfile.c @@ -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) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Error renaming log from %s to %s [%s]\n", from_filename, to_filename, strerror(errno)); - goto end; + if (errno != ENOENT) { + goto end; + } } }