small changes for logger.c
parent
35aa996333
commit
12aab5f94c
|
|
@ -818,7 +818,6 @@ int log_rotate(LogContext *pContext)
|
||||||
close(pContext->log_fd);
|
close(pContext->log_fd);
|
||||||
|
|
||||||
current_time = get_current_time();
|
current_time = get_current_time();
|
||||||
localtime_r(¤t_time, &tm);
|
|
||||||
if (tm.tm_hour == 0 && tm.tm_min <= 1)
|
if (tm.tm_hour == 0 && tm.tm_min <= 1)
|
||||||
{
|
{
|
||||||
if (strstr(pContext->rotate_time_format, "%H") == NULL
|
if (strstr(pContext->rotate_time_format, "%H") == NULL
|
||||||
|
|
@ -826,9 +825,9 @@ int log_rotate(LogContext *pContext)
|
||||||
&& strstr(pContext->rotate_time_format, "%S") == NULL)
|
&& strstr(pContext->rotate_time_format, "%S") == NULL)
|
||||||
{
|
{
|
||||||
current_time -= 120;
|
current_time -= 120;
|
||||||
|
}
|
||||||
|
}
|
||||||
localtime_r(¤t_time, &tm);
|
localtime_r(¤t_time, &tm);
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
memset(old_filename, 0, sizeof(old_filename));
|
memset(old_filename, 0, sizeof(old_filename));
|
||||||
len = sprintf(old_filename, "%s.", pContext->log_filename);
|
len = sprintf(old_filename, "%s.", pContext->log_filename);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue