]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
[mod_logfile] Continue renaming if a logfile doesn't exist
authorRoyce Mitchell <royce3@gmail.com>
Tue, 1 Nov 2022 16:19:15 +0000 (11:19 -0500)
committerGitHub <noreply@github.com>
Tue, 1 Nov 2022 16:19:15 +0000 (19:19 +0300)
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

index 4dc3c6a7e828d4510de68bf8dbc0d51cabb17a00..877403c5b64ca42a706cfe8dc79a6cc1baa9e871 100644 (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) {
                                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;
+                               }
                        }
                }