mirror of
https://github.com/irssi/irssi.git
synced 2025-02-02 15:08:01 -05:00
Rotate time names changed :) week -> weekly, day -> daily, etc.
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@308 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
parent
7503302d23
commit
9b6d5f7e99
@ -209,14 +209,14 @@ LOG_REC *log_find(const char *fname)
|
|||||||
const char *log_rotate2str(int rotate)
|
const char *log_rotate2str(int rotate)
|
||||||
{
|
{
|
||||||
switch (rotate) {
|
switch (rotate) {
|
||||||
case LOG_ROTATE_HOUR:
|
case LOG_ROTATE_HOURLY:
|
||||||
return "hour";
|
return "hourly";
|
||||||
case LOG_ROTATE_DAY:
|
case LOG_ROTATE_DAILY:
|
||||||
return "day";
|
return "daily";
|
||||||
case LOG_ROTATE_WEEK:
|
case LOG_ROTATE_WEEKLY:
|
||||||
return "week";
|
return "weekly";
|
||||||
case LOG_ROTATE_MONTH:
|
case LOG_ROTATE_MONTHLY:
|
||||||
return "month";
|
return "monthly";
|
||||||
}
|
}
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
@ -228,13 +228,14 @@ int log_str2rotate(const char *str)
|
|||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
if (g_strncasecmp(str, "hour", 4) == 0)
|
if (g_strncasecmp(str, "hour", 4) == 0)
|
||||||
return LOG_ROTATE_HOUR;
|
return LOG_ROTATE_HOURLY;
|
||||||
if (g_strncasecmp(str, "day", 3) == 0)
|
if (g_strncasecmp(str, "day", 3) == 0 ||
|
||||||
return LOG_ROTATE_DAY;
|
g_strncasecmp(str, "daily", 5) == 0)
|
||||||
|
return LOG_ROTATE_DAILY;
|
||||||
if (g_strncasecmp(str, "week", 4) == 0)
|
if (g_strncasecmp(str, "week", 4) == 0)
|
||||||
return LOG_ROTATE_WEEK;
|
return LOG_ROTATE_WEEKLY;
|
||||||
if (g_strncasecmp(str, "month", 5) == 0)
|
if (g_strncasecmp(str, "month", 5) == 0)
|
||||||
return LOG_ROTATE_MONTH;
|
return LOG_ROTATE_MONTHLY;
|
||||||
if (g_strncasecmp(str, "never", 5) == 0)
|
if (g_strncasecmp(str, "never", 5) == 0)
|
||||||
return LOG_ROTATE_NEVER;
|
return LOG_ROTATE_NEVER;
|
||||||
|
|
||||||
@ -354,13 +355,13 @@ static int sig_rotate_check(void)
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
tm = localtime(&rec->opened);
|
tm = localtime(&rec->opened);
|
||||||
if (rec->rotate == LOG_ROTATE_MONTH) {
|
if (rec->rotate == LOG_ROTATE_MONTHLY) {
|
||||||
if (tm->tm_mon == tm_now.tm_mon)
|
if (tm->tm_mon == tm_now.tm_mon)
|
||||||
continue;
|
continue;
|
||||||
} else if (rec->rotate == LOG_ROTATE_WEEK) {
|
} else if (rec->rotate == LOG_ROTATE_WEEKLY) {
|
||||||
if (tm->tm_wday != 1 || tm->tm_mday == tm_now.tm_mday)
|
if (tm->tm_wday != 1 || tm->tm_mday == tm_now.tm_mday)
|
||||||
continue;
|
continue;
|
||||||
} else if (rec->rotate == LOG_ROTATE_DAY) {
|
} else if (rec->rotate == LOG_ROTATE_DAILY) {
|
||||||
if (tm->tm_mday == tm_now.tm_mday)
|
if (tm->tm_mday == tm_now.tm_mday)
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -3,10 +3,10 @@
|
|||||||
|
|
||||||
enum {
|
enum {
|
||||||
LOG_ROTATE_NEVER,
|
LOG_ROTATE_NEVER,
|
||||||
LOG_ROTATE_HOUR,
|
LOG_ROTATE_HOURLY,
|
||||||
LOG_ROTATE_DAY,
|
LOG_ROTATE_DAILY,
|
||||||
LOG_ROTATE_WEEK,
|
LOG_ROTATE_WEEKLY,
|
||||||
LOG_ROTATE_MONTH
|
LOG_ROTATE_MONTHLY
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
Loading…
Reference in New Issue
Block a user