Репозиторий ALT Linux backports/2.4
Последнее обновление: 9 июля 2008 | Пакетов: 497 | Посещений: 1584235
 поиск   регистрация   авторизация 
 
Группа :: Система/Серверы
Пакет: ejabberd-jit

 Главная   Изменения   Спек   Патчи   Загрузить   Bugs and FR 

Патч: jabber-jit-1.1.5-no-thanks-we-have-logrotate.patch


--- jit-1.1.5/jabberd/base/base_file.c.patch-logname	2003-03-23 04:15:37 +0300
+++ jit-1.1.5/jabberd/base/base_file.c	2003-03-23 04:20:45 +0300
@@ -42,10 +42,7 @@
 {
   char* message = NULL;
   basefile bf = (basefile) arg;
-  char date[50],buf[200];
-  struct tm *today;
   unsigned long ltime;
-  FILE * f;
 
   time( &ltime );
 
@@ -58,17 +55,9 @@
     /* lock */
     pthread_mutex_lock(&(bf->sem));
 
-    today = localtime( &ltime );
-    /* if day changed or new raport */
-    if ((bf->yesterday.tm_mday != today->tm_mday) || (bf->f == NULL)) {
-      memcpy(&(bf->yesterday),today,sizeof(struct tm));
-      strftime((char *)date,128,"%Y_%m_%d",today);
-      sprintf(buf,"%s_%s.log",bf->filename,date);    
-      
-      f = bf->f;
-      bf->f = fopen(buf,"at");
-      if (f)
-	fclose(f);
+    /* if new raport */
+    if (bf->f == NULL) {
+      bf->f = fopen(bf->filename,"at");
     }
 
     /* unlock */
--- jit-1.1.5/jabberd/wplog.c.patch-logname	2003-02-19 16:00:45 +0300
+++ jit-1.1.5/jabberd/wplog.c	2003-03-23 04:23:05 +0300
@@ -13,9 +13,6 @@
 result wplog_beat(void *arg)
 {
   FILE * plik;
-  char date[50],buf[200];
-  struct tm *today;
-  unsigned long ltime;
   unsigned int msg,pres,query,files;
   unsigned int msg1,pres1,query1,files1;
   wplog_packet wplogp = (wplog_packet)arg;
@@ -46,12 +43,7 @@
   if (query < 0) query = -query;
   if (files < 0) files = -files;
 
-  time( &ltime );
-  today = localtime( &ltime );
-  strftime((char *)date,128,"%Y_%m_%d",today);
-  sprintf(buf,"%s_%s.log",wplogp->file,date);    
-
-  plik = fopen(buf, "at");
+  plik = fopen(wplogp->file, "at");
   if (plik) {
     fprintf(plik, "%s m:\t%u\tp:\t%u\tq:\t%u\tf:\t%u\r\n", 
 	    jutil_timestamplocal(),msg,pres,query,files);
 
design & coding: Vladimir Lettiev aka crux © 2004-2005