12 lines
524 B
Diff
12 lines
524 B
Diff
|
--- 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;
|