mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-04-25 12:10:18 +00:00
[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:
parent
6184eb5ffd
commit
1213217ccc
@ -163,9 +163,11 @@ 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));
|
||||||
|
if (errno != ENOENT) {
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
sprintf((char *) to_filename, "%s.%i", profile->logfile, i);
|
sprintf((char *) to_filename, "%s.%i", profile->logfile, i);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user