[packages] logrotate: update to v3.7.8
[openwrt/svn-archive/archive.git] / utils / logrotate / patches / 006-weekly.patch
index 8a371e8e003ff9860992947e38ab53dd04b5a14c..a86160455e9516b95b5cf2be0d2be1c9a726225c 100644 (file)
@@ -1,22 +1,18 @@
---- logrotate-3.7.1-old/logrotate.c    2004-10-19 23:41:24.000000000 +0200
-+++ logrotate-3.7.1-new/logrotate.c    2005-10-02 17:29:22.380767321 +0200
-@@ -424,12 +424,15 @@ int findNeedRotating(logInfo * log, int 
-         switch (log->criterium) {
-           case ROT_WEEKLY:
-             /* rotate if:
--                  1) the current weekday is before the weekday of the
--                     last rotation
-+                  1) the day of the week is the same as the day of the week of
-+                     the previous rotation but not the same day of the year
-+                     this will rotate it on the same day every week, but not
-+                     twice a day.
-                   2) more then a week has passed since the last
-                      rotation */
--            state->doRotate = ((now.tm_wday < state->lastRotated.tm_wday) ||
--                             ((mktime(&now) - mktime(&state->lastRotated)) >
-+            state->doRotate = ((now.tm_wday == state->lastRotated.tm_wday &&
-+                              now.tm_yday != state->lastRotated.tm_yday) ||
-+                              ((mktime(&now) - mktime(&state->lastRotated)) >
-                               (7 * 24 * 3600)));
-             break;
-           case ROT_MONTHLY:
+--- a/logrotate.c
++++ b/logrotate.c
+@@ -567,9 +567,14 @@ int findNeedRotating(struct logInfo *log
+           /* rotate if:
+              1) the current weekday is before the weekday of the
+              last rotation
++             1) the day of the week is the same as the day of the week of
++             the previous rotation but not the same day of the year
++             this will rotate it on the same day every week, but not
++             twice a day.
+              2) more then a week has passed since the last
+              rotation */
+-          state->doRotate = ((now.tm_wday < state->lastRotated.tm_wday)
++          state->doRotate = ((now.tm_wday == state->lastRotated.tm_wday
++                                   && now.tm_yday != state->lastRotated.tm_yday)
+                              ||
+                              ((mktime(&now) -
+                                mktime(&state->lastRotated)) >