summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1996-08-31 14:20:37 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1996-08-31 14:20:37 +0000
commit5a154134cb827d9b13e6f2692b6b7e4cacd059e8 (patch)
treeae4e85606f9ba098dc898303102c5a51acd4a7e6 /usr.bin
parentb3e1700501493e52b7562db1f2dc65400b624692 (diff)
do ngen == 0 correctly; netbsd pr#2724; kstailey@dol-esa.gov
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/newsyslog/newsyslog.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/usr.bin/newsyslog/newsyslog.c b/usr.bin/newsyslog/newsyslog.c
index 5f86f643f00..67834a8f459 100644
--- a/usr.bin/newsyslog/newsyslog.c
+++ b/usr.bin/newsyslog/newsyslog.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: newsyslog.c,v 1.4 1996/07/22 10:09:17 deraadt Exp $ */
+/* $OpenBSD: newsyslog.c,v 1.5 1996/08/31 14:20:36 deraadt 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.4 1996/07/22 10:09:17 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: newsyslog.c,v 1.5 1996/08/31 14:20:36 deraadt Exp $";
#endif /* not lint */
#ifndef CONF
@@ -427,10 +427,18 @@ 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 (noaction)
- printf("mv %s to %s\n",log,file1);
- else
- (void) rename(log,file1);
+ if (numdays == -1) {
+ if (noaction)
+ printf("rm %s\n",log);
+ else
+ (void) unlink(log);
+ } else {
+ if (noaction)
+ printf("mv %s to %s\n",log,file1);
+ else
+ (void) rename(log,file1);
+ }
+
if (noaction)
printf("Start new log...");
else {