summaryrefslogtreecommitdiff
path: root/usr.bin/newsyslog/newsyslog.c
diff options
context:
space:
mode:
authorThorsten Lockert <tholo@cvs.openbsd.org>1996-09-02 18:47:17 +0000
committerThorsten Lockert <tholo@cvs.openbsd.org>1996-09-02 18:47:17 +0000
commit4a1b670d2797a4dca43bc3d7a44cb5e9634f878f (patch)
tree4d1eb43a5baefa81bfd19c30dc058f97d8d5f22e /usr.bin/newsyslog/newsyslog.c
parent034a7517a6aca9a9d6d6c5c8272734e055649a1c (diff)
Save the log file if the original number of days was > 0; don't rely on
being able to use numdays after aging the existing logfiles
Diffstat (limited to 'usr.bin/newsyslog/newsyslog.c')
-rw-r--r--usr.bin/newsyslog/newsyslog.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/usr.bin/newsyslog/newsyslog.c b/usr.bin/newsyslog/newsyslog.c
index 67834a8f459..0368eb46d9a 100644
--- a/usr.bin/newsyslog/newsyslog.c
+++ b/usr.bin/newsyslog/newsyslog.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: newsyslog.c,v 1.5 1996/08/31 14:20:36 deraadt Exp $ */
+/* $OpenBSD: newsyslog.c,v 1.6 1996/09/02 18:47:16 tholo Exp $ */
/*
* This file contains changes from the Open Software Foundation.
@@ -29,7 +29,7 @@ provided "as is" without express or implied warranty.
*/
#ifndef lint
-static char rcsid[] = "$OpenBSD: newsyslog.c,v 1.5 1996/08/31 14:20:36 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: newsyslog.c,v 1.6 1996/09/02 18:47:16 tholo Exp $";
#endif /* not lint */
#ifndef CONF
@@ -380,6 +380,7 @@ dotrim(log,numdays,flags,perm,owner_uid,group_gid)
char zfile1[128], zfile2[128];
int fd;
struct stat st;
+ int days = numdays;
#ifdef _IBMR2
/* AIX 3.1 has a broken fchown- if the owner_uid is -1, it will actually */
@@ -427,7 +428,7 @@ dotrim(log,numdays,flags,perm,owner_uid,group_gid)
if (!noaction && !(flags & CE_BINARY))
(void) log_trim(log); /* Report the trimming to the old log */
- if (numdays == -1) {
+ if (days == 0) {
if (noaction)
printf("rm %s\n",log);
else