summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBryan Cantrill <bryan@joyent.com>2013-01-29 02:25:28 +0000
committerRobert Mustacchi <rm@joyent.com>2013-11-22 14:33:24 -0800
commit4bc1f5b268a3ca72608b1759f9a984f8e4b51651 (patch)
treec222a6fc84dbe5815c56725989ba9dfc4903e24a
parentfdaa282462aa62743dd85b0e8be1266ba99a8e8a (diff)
downloadillumos-joyent-4bc1f5b268a3ca72608b1759f9a984f8e4b51651.tar.gz
4301 logadm unnecessarily copies historical logs when "-c" is specified
Reviewed by: Joshua M. Clulow <josh@sysmgr.org> Reviewed by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net> Approved by: Richard Lowe <richlowe@richlowe.net>
-rw-r--r--usr/src/cmd/logadm/main.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/usr/src/cmd/logadm/main.c b/usr/src/cmd/logadm/main.c
index 1b7cceb5c7..b03782c3c3 100644
--- a/usr/src/cmd/logadm/main.c
+++ b/usr/src/cmd/logadm/main.c
@@ -830,7 +830,7 @@ rotateto(struct fn *fnp, struct opts *opts, int n, struct fn *recentlog,
fn_free(dirname);
/* do the rename */
- if (opts_count(opts, "c") != NULL) {
+ if (n == 0 && opts_count(opts, "c") != NULL) {
docopytruncate(opts, fn_s(fnp), fn_s(newfile));
} else if (n == 0 && opts_count(opts, "M")) {
struct fn *rawcmd = fn_new(opts_optarg(opts, "M"));