Index: new/lib/logger.c
===================================================================
---- new.orig/lib/logger.c 2012-07-17 14:40:47.000000000 +0200
-+++ new/lib/logger.c 2012-07-17 14:42:16.000000000 +0200
-@@ -57,7 +57,7 @@
- static pid_t logger_pid;
+--- a/lib/logger.c
++++ b/lib/logger.c
+@@ -97,7 +97,7 @@ static pid_t logger_pid;
static key_t semkey;
+ static char *log_buff;
-static int64_t max_logsize = 500 * 1024 * 1024; /*500MB*/
-+static int64_t max_logsize = 256 * 1024 * 1024; /*256MB*/
++static int64_t max_logsize = 256 * 1024 * 1024; /*500MB*/
- pthread_mutex_t logsize_lock = PTHREAD_MUTEX_INITIALIZER;
+ static pthread_mutex_t logsize_lock = PTHREAD_MUTEX_INITIALIZER;
-@@ -345,13 +345,7 @@
+@@ -357,14 +357,7 @@ static notrace void rotate_log(void)
if (access(log_nowname, R_OK) == 0) {
char old_logfile[256];
- struct tm tm;
- time(&t);
- localtime_r((const time_t *)&t, &tm);
-- sprintf(old_logfile, "%s.%04d-%02d-%02d-%02d-%02d",
-- log_nowname, tm.tm_year + 1900, tm.tm_mon + 1,
-- tm.tm_mday, tm.tm_hour, tm.tm_min);
+- snprintf(old_logfile, sizeof(old_logfile),
+- "%s.%04d-%02d-%02d-%02d-%02d",
+- log_nowname, tm.tm_year + 1900, tm.tm_mon + 1,
+- tm.tm_mday, tm.tm_hour, tm.tm_min);
+ sprintf(old_logfile, "%s.1", log_nowname);
rename(log_nowname, old_logfile);
}