I'm sorry, this time against -current.
Regards
André
Index: newsyslog.c
===================================================================
RCS file: /cvs/src/usr.bin/newsyslog/newsyslog.c,v
retrieving revision 1.92
diff -u -r1.92 newsyslog.c
--- newsyslog.c 26 Nov 2013 13:19:07 -0000 1.92
+++ newsyslog.c 4 Mar 2014 20:09:35 -0000
@@ -295,6 +295,7 @@
{
struct stat sb;
int modhours;
+ int notrim = 0;
off_t size;
if (lstat(ent->log, &sb) != 0)
@@ -323,11 +324,11 @@
if (ent->flags & CE_TRIMAT && !force) {
if (timenow < ent->trim_at ||
difftime(timenow, ent->trim_at) >= 60 * 60) {
- DPRINTF(("--> will trim at %s",
+ DPRINTF(("will trim at %.24s ",
ctime(&ent->trim_at)));
- return;
+ notrim = 1;
} else if (ent->hours <= 0) {
- DPRINTF(("--> time is up\n"));
+ DPRINTF(("time is up "));
}
}
if (ent->size > 0)
@@ -337,7 +338,7 @@
DPRINTF(("age (hr): %d [%d] ", modhours, ent->hours));
if (monitormode && (ent->flags & CE_MONITOR) && domonitor(ent))
DPRINTF(("--> monitored\n"));
- else if (!monitormode &&
+ else if (!monitormode && !notrim &&
(force || (ent->size > 0 && size >= ent->size) ||
(ent->hours <= 0 && (ent->flags & CE_TRIMAT)) ||
(ent->hours > 0 && (modhours >= ent->hours || modhours < 0)