summaryrefslogtreecommitdiffstats
path: root/usr.sbin/newsyslog
diff options
context:
space:
mode:
authorjkh <jkh@FreeBSD.org>1996-09-09 15:32:26 +0000
committerjkh <jkh@FreeBSD.org>1996-09-09 15:32:26 +0000
commit398ef266db7d9602f783d0c7bd43193b2c2222bb (patch)
tree1e0d2d648100b4515445b823bd136f5c4eac119e /usr.sbin/newsyslog
parent3a2a3320ba594db8160511a916b91ee3e4c74904 (diff)
downloadFreeBSD-src-398ef266db7d9602f783d0c7bd43193b2c2222bb.zip
FreeBSD-src-398ef266db7d9602f783d0c7bd43193b2c2222bb.tar.gz
Doh! Actually read the patch I applied and see what it was *trying* to do,
then make it do that. Error-of-my-ways-pointed-out-by: Bob Willcox <bob@luke.pmr.com>
Diffstat (limited to 'usr.sbin/newsyslog')
-rw-r--r--usr.sbin/newsyslog/newsyslog.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/usr.sbin/newsyslog/newsyslog.c b/usr.sbin/newsyslog/newsyslog.c
index 4fbfbfa..fcf8fc8 100644
--- a/usr.sbin/newsyslog/newsyslog.c
+++ b/usr.sbin/newsyslog/newsyslog.c
@@ -25,11 +25,11 @@ provided "as is" without express or implied warranty.
* keeping the a specified number of backup files around.
*
* $Source: /home/ncvs/src/usr.sbin/newsyslog/newsyslog.c,v $
- * $Author: alex $
+ * $Author: jkh $
*/
#ifndef lint
-static char rcsid[] = "$Id: newsyslog.c,v 1.5 1996/06/08 23:32:10 alex Exp $";
+static char rcsid[] = "$Id: newsyslog.c,v 1.6 1996/09/06 06:36:07 jkh Exp $";
#endif /* not lint */
#ifndef CONF
@@ -371,7 +371,7 @@ static void dotrim(log,numdays,flags,perm,owner_uid,group_gid)
{
char file1 [MAXPATHLEN+1], file2 [MAXPATHLEN+1];
char zfile1[MAXPATHLEN+1], zfile2[MAXPATHLEN+1];
- int fd;
+ int fd, _numdays;
struct stat st;
#ifdef _IBMR2
@@ -396,6 +396,7 @@ static void dotrim(log,numdays,flags,perm,owner_uid,group_gid)
}
/* Move down log files */
+ _numdays = numdays; /* preserve */
while (numdays--) {
(void) strcpy(file2,file1);
(void) sprintf(file1,"%s.%d",log,numdays);
@@ -420,7 +421,7 @@ static void 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 (!_numdays) {
if (noaction)
printf("rm %s\n",log);
else
OpenPOWER on IntegriCloud