Sophie

Sophie

distrib > Fedora > 13 > i386 > media > updates-src > by-pkgid > c3f0d217e4d137a776c15acdc78d34fa > files > 8

logrotate-3.7.8-9.fc13.src.rpm

--- logrotate-3.7.8/logrotate.c.readonly	2009-12-09 09:09:10.000000000 -0800
+++ logrotate-3.7.8/logrotate.c	2009-12-09 09:21:37.000000000 -0800
@@ -432,7 +432,7 @@ static int copyTruncate(char *currLog, c
     message(MESS_DEBUG, "copying %s to %s\n", currLog, saveLog);
 
     if (!debug) {
-	if ((fdcurr = open(currLog, O_RDWR)) < 0) {
+	if ((fdcurr = open(currLog, (flags & LOG_FLAG_COPY) ? O_RDONLY : O_RDWR)) < 0) {
 	    message(MESS_ERROR, "error opening %s: %s\n", currLog,
 		    strerror(errno));
 	    return 1;