diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 1996-08-31 14:20:37 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 1996-08-31 14:20:37 +0000 |
commit | 5a154134cb827d9b13e6f2692b6b7e4cacd059e8 (patch) | |
tree | ae4e85606f9ba098dc898303102c5a51acd4a7e6 /usr.bin | |
parent | b3e1700501493e52b7562db1f2dc65400b624692 (diff) |
do ngen == 0 correctly; netbsd pr#2724; kstailey@dol-esa.gov
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/newsyslog/newsyslog.c | 20 |
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 { |