logrotate/logrotate-3.7.8-readonly.patch

12 lines
524 B
Diff
Raw Normal View History

2009-12-17 14:26:55 +00:00
--- 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;