Blame SOURCES/logrotate-3.8.6-force.patch

2d94e1
Index: /trunk/logrotate.c
2d94e1
===================================================================
2d94e1
--- trunk/logrotate.c	(revision 437)
2d94e1
+++ trunk/logrotate.c	(revision 438)
2d94e1
@@ -831,9 +831,10 @@
2d94e1
 	}
2d94e1
 
2d94e1
-    if (log->criterium == ROT_SIZE) {
2d94e1
+    if (force) {
2d94e1
+	/* user forced rotation of logs from command line */
2d94e1
+	state->doRotate = 1;   
2d94e1
+    }
2d94e1
+    else if (log->criterium == ROT_SIZE) {
2d94e1
 	state->doRotate = (sb.st_size >= log->threshhold);
2d94e1
-    } else if (force) {
2d94e1
-	/* user forced rotation of logs from command line */
2d94e1
-	state->doRotate = 1;
2d94e1
     } else if (mktime(&state->lastRotated) - mktime(&now) > (25 * 3600)) {
2d94e1
         /* 25 hours allows for DST changes as well as geographical moves */
2d94e1
Index: /trunk/test/test
2d94e1
===================================================================
2d94e1
--- trunk/test/test	(revision 437)
2d94e1
+++ trunk/test/test	(revision 438)
2d94e1
@@ -1335,3 +1335,16 @@
2d94e1
 EOF
2d94e1
 
2d94e1
+cleanup 53
2d94e1
+
2d94e1
+# ------------------------------- Test 53 ------------------------------------
2d94e1
+# test if --force works
2d94e1
+preptest test.log 53 1 0
2d94e1
+
2d94e1
+$RLR test-config.53 --force
2d94e1
+
2d94e1
+checkoutput <
2d94e1
+test.log 0
2d94e1
+test.log.1 0 zero
2d94e1
+EOF
2d94e1
+
2d94e1
 cleanup
2d94e1
Index: /trunk/test/test-config.53.in
2d94e1
===================================================================
2d94e1
--- trunk/test/test-config.53.in	(revision 438)
2d94e1
+++ trunk/test/test-config.53.in	(revision 438)
2d94e1
@@ -0,0 +1,7 @@
2d94e1
+create
2d94e1
+
2d94e1
+&DIR&/test.log {
2d94e1
+	rotate 14
2d94e1
+	size 4096
2d94e1
+	missingok
2d94e1
+}