View | Details | Raw Unified | Return to bug 115486 | Differences between
and this patch

Collapse All | Expand All

(-)newsyslog.c (-1 / +15 lines)
Lines 127-132 Link Here
127
	struct ptime_data *trim_at;	/* Specific time to do trimming */
127
	struct ptime_data *trim_at;	/* Specific time to do trimming */
128
	unsigned int permissions;	/* File permissions on the log */
128
	unsigned int permissions;	/* File permissions on the log */
129
	int flags;		/* CE_COMPACT, CE_BZCOMPACT, CE_BINARY */
129
	int flags;		/* CE_COMPACT, CE_BZCOMPACT, CE_BINARY */
130
	int nuncompact;		/* number of rotations that should not
131
				 * be compressed; -1 turns this off */
130
	int sig;		/* Signal to send */
132
	int sig;		/* Signal to send */
131
	int def_cfg;		/* Using the <default> rule for this file */
133
	int def_cfg;		/* Using the <default> rule for this file */
132
	struct conf_entry *next;/* Linked list pointer */
134
	struct conf_entry *next;/* Linked list pointer */
Lines 1187-1192 Link Here
1187
		}
1189
		}
1188
1190
1189
		for (; q && *q && !isspacech(*q); q++) {
1191
		for (; q && *q && !isspacech(*q); q++) {
1192
			if (isdigit(*q)) {
1193
				working->nuncompact = strtol(q, NULL, 10);
1194
				while(isdigit(*(q+1))) q++;
1195
				continue;
1196
			}
1190
			switch (tolowerch(*q)) {
1197
			switch (tolowerch(*q)) {
1191
			case 'b':
1198
			case 'b':
1192
				working->flags |= CE_BINARY;
1199
				working->flags |= CE_BINARY;
Lines 1456-1461 Link Here
1456
			(void)rename(zfile1, zfile2);
1463
			(void)rename(zfile1, zfile2);
1457
		}
1464
		}
1458
		change_attrs(zfile2, ent);
1465
		change_attrs(zfile2, ent);
1466
		if ((flags & (CE_COMPACT | CE_BZCOMPACT)) &&
1467
		    (ent->nuncompact != -1) &&
1468
		    (numlogs_c == ent->nuncompact)) {
1469
			free_or_keep = KEEP_ENT;
1470
			save_zipwork(ent, NULL, ent->fsize, file2);
1471
		}
1459
	}
1472
	}
1460
1473
1461
	if (ent->numlogs > 0) {
1474
	if (ent->numlogs > 0) {
Lines 1494-1500 Link Here
1494
	swork = NULL;
1507
	swork = NULL;
1495
	if (ent->pid_file != NULL)
1508
	if (ent->pid_file != NULL)
1496
		swork = save_sigwork(ent);
1509
		swork = save_sigwork(ent);
1497
	if (ent->numlogs > 0 && (flags & (CE_COMPACT | CE_BZCOMPACT))) {
1510
	if (ent->numlogs > 0 && (flags & (CE_COMPACT | CE_BZCOMPACT))
1511
	    && ent->nuncompact == -1) {
1498
		/*
1512
		/*
1499
		 * The zipwork_entry will include a pointer to this
1513
		 * The zipwork_entry will include a pointer to this
1500
		 * conf_entry, so the conf_entry should not be freed.
1514
		 * conf_entry, so the conf_entry should not be freed.
(-)newsyslog.conf.5 (+10 lines)
Lines 242-247 Link Here
242
files matched by this line.
242
files matched by this line.
243
The following are valid flags:
243
The following are valid flags:
244
.Bl -tag -width indent
244
.Bl -tag -width indent
245
.It Ar number
246
In combination with one of the compression flags
247
.Cm J
248
or
249
.Cm Z
250
, this selects which one of the already-rotated archives will be
251
subject to the requested compression.  If it is omitted and compression
252
is specified, the most recently-rotated archive file will be compressed.
253
(Compression is done subsequent to rotation, but the selection
254
specified here is done prior to the rotation.)
245
.It Cm B
255
.It Cm B
246
indicates that the log file is a binary file, or has some
256
indicates that the log file is a binary file, or has some
247
special format.
257
special format.

Return to bug 115486