]> git.pld-linux.org Git - packages/nagios.git/blobdiff - archivelog-timeformat.patch
- updated for version 3.3.1.
[packages/nagios.git] / archivelog-timeformat.patch
index 9d9eef8d131edbacd9f00491547d80f92e9faa79..33ab0672998bd1bdcd36885a2aea57d327065af8 100644 (file)
@@ -7,20 +7,20 @@ ideally this should came from config (date_format=iso8601)
        stat_result = stat(log_file, &log_file_stat);
  
        /* get the archived filename to use */
--      asprintf(&log_archive,"%s%snagios-%02d-%02d-%d-%02d.log",log_archive_path,(log_archive_path[strlen(log_archive_path)-1]=='/')?"":"/",t->tm_mon+1,t->tm_mday,t->tm_year+1900,t->tm_hour);
+-      asprintf(&log_archive, "%s%snagios-%02d-%02d-%d-%02d.log", log_archive_path, (log_archive_path[strlen(log_archive_path)-1] == '/') ? "" : "/", t->tm_mon + 1, t->tm_mday, t->tm_year + 1900, t->tm_hour);
 -
-+      asprintf(&log_archive,"%s%snagios-%04d-%02d-%02d-%02d.log",log_archive_path,(log_archive_path[strlen(log_archive_path)-1]=='/')?"":"/", t->tm_year+1900, t->tm_mon+1,t->tm_mday,t->tm_hour); 
++      asprintf(&log_archive," %s%snagios-%04d-%02d-%02d-%02d.log", log_archive_path, (log_archive_path[strlen(log_archive_path)-1] == '/') ? "" : "/", t->tm_year + 1900, t->tm_mon + 1, t->tm_mday, t->tm_hour); 
        /* rotate the log file */
-       rename_result=my_rename(log_file,log_archive);
+       rename_result = my_rename(log_file, log_archive);
  
 --- nagios-3.2.3/cgi/cgiutils.c~       2010-12-04 21:34:34.000000000 +0200
 +++ nagios-3.2.3/cgi/cgiutils.c        2010-12-04 23:34:28.915968009 +0200
 @@ -1604,7 +1604,7 @@
-       t=localtime(&this_scheduled_log_rotation);
+       t = localtime(&this_scheduled_log_rotation);
  
        /* use the time that the log rotation occurred to figure out the name of the log file */
--      snprintf(buffer,buffer_length,"%snagios-%02d-%02d-%d-%02d.log",log_archive_path,t->tm_mon+1,t->tm_mday,t->tm_year+1900,t->tm_hour);
-+      snprintf(buffer,buffer_length,"%snagios-%04d-%02d-%02d-%02d.log",log_archive_path,t->tm_year+1900,t->tm_mon+1,t->tm_mday,t->tm_hour);
-       buffer[buffer_length-1]='\x0';
+-      snprintf(buffer, buffer_length, "%snagios-%02d-%02d-%d-%02d.log", log_archive_path, t->tm_mon + 1, t->tm_mday, t->tm_year + 1900, t->tm_hour);
++      snprintf(buffer, buffer_length, "%snagios-%04d-%02d-%02d-%02d.log", log_archive_path, t->tm_year + 1900, t->tm_mon + 1, t->tm_mday, t->tm_hour);
+       buffer[buffer_length-1] = '\x0';
  
        return;
This page took 0.12277 seconds and 4 git commands to generate.