summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorphessler <phessler@openbsd.org>2012-01-15 13:02:12 +0000
committerphessler <phessler@openbsd.org>2012-01-15 13:02:12 +0000
commit64a21c9e19a6b6ec683c5c3150c16f0eca6bbda4 (patch)
treedc2545b5cb36e3abbfe99055bebff8a4d95f6b0c
parentDocument the EXIT STATUS and remove an outdated related comment. (diff)
downloadwireguard-openbsd-64a21c9e19a6b6ec683c5c3150c16f0eca6bbda4.tar.xz
wireguard-openbsd-64a21c9e19a6b6ec683c5c3150c16f0eca6bbda4.zip
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@
-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;