summaryrefslogtreecommitdiff
path: root/usr.bin/newsyslog
diff options
context:
space:
mode:
authorPeter Hessler <phessler@cvs.openbsd.org>2012-01-15 13:02:13 +0000
committerPeter Hessler <phessler@cvs.openbsd.org>2012-01-15 13:02:13 +0000
commitcda6d851065e813a9068492d70071d13baeab7c2 (patch)
tree2eecd41de77389bffd3ff54f0318cb067ce3ab1e /usr.bin/newsyslog
parenta8dacf6f0c85b10ae9582a003ed02b9b02bbc3cb (diff)
When we only rotate a log file once a month, the "next rotate" output
shows the current month, even when that date has passed. Fix to show the correct rotation date. pointed out by jeremy@ OK jeremy@, guenther@, miod@
Diffstat (limited to 'usr.bin/newsyslog')
-rw-r--r--usr.bin/newsyslog/newsyslog.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/usr.bin/newsyslog/newsyslog.c b/usr.bin/newsyslog/newsyslog.c
index 3a845e7ef90..f7b936ba5b8 100644
--- a/usr.bin/newsyslog/newsyslog.c
+++ b/usr.bin/newsyslog/newsyslog.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: newsyslog.c,v 1.89 2011/05/19 05:11:39 lum Exp $ */
+/* $OpenBSD: newsyslog.c,v 1.90 2012/01/15 13:02:12 phessler Exp $ */
/*
* Copyright (c) 1999, 2002, 2003 Todd C. Miller <Todd.Miller@courtesan.com>
@@ -1314,6 +1314,8 @@ parseDWM(char *s)
if (l > nd)
return (-1);
+ if (l < tm.tm_mday)
+ tm.tm_mon++;
tm.tm_mday = l;
}
break;