summaryrefslogtreecommitdiffstats
path: root/meta/recipes-extended/logrotate/logrotate/act-as-mv-when-rotate.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-extended/logrotate/logrotate/act-as-mv-when-rotate.patch')
-rw-r--r--meta/recipes-extended/logrotate/logrotate/act-as-mv-when-rotate.patch22
1 files changed, 11 insertions, 11 deletions
diff --git a/meta/recipes-extended/logrotate/logrotate/act-as-mv-when-rotate.patch b/meta/recipes-extended/logrotate/logrotate/act-as-mv-when-rotate.patch
index acef5ccbe9..671fce4ac8 100644
--- a/meta/recipes-extended/logrotate/logrotate/act-as-mv-when-rotate.patch
+++ b/meta/recipes-extended/logrotate/logrotate/act-as-mv-when-rotate.patch
@@ -1,4 +1,4 @@
1From ef1ea905831c5bcd63e04149571c10d75ff8f028 Mon Sep 17 00:00:00 2001 1From 17d57a2a923a4af53c8910a9999aebeab3f5d83a Mon Sep 17 00:00:00 2001
2From: Robert Yang <liezhi.yang@windriver.com> 2From: Robert Yang <liezhi.yang@windriver.com>
3Date: Tue, 17 Feb 2015 21:08:07 -0800 3Date: Tue, 17 Feb 2015 21:08:07 -0800
4Subject: [PATCH] Act as the "mv" command when rotate log 4Subject: [PATCH] Act as the "mv" command when rotate log
@@ -15,10 +15,10 @@ Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
15 1 file changed, 59 insertions(+), 12 deletions(-) 15 1 file changed, 59 insertions(+), 12 deletions(-)
16 16
17diff --git a/logrotate.c b/logrotate.c 17diff --git a/logrotate.c b/logrotate.c
18index 25902bc..afa1a90 100644 18index 45b3eb6..231371a 100644
19--- a/logrotate.c 19--- a/logrotate.c
20+++ b/logrotate.c 20+++ b/logrotate.c
21@@ -1434,6 +1434,53 @@ static int findNeedRotating(struct logInfo *log, int logNum, int force) 21@@ -1463,6 +1463,53 @@ static int findNeedRotating(const struct logInfo *log, unsigned logNum, int forc
22 return 0; 22 return 0;
23 } 23 }
24 24
@@ -72,7 +72,7 @@ index 25902bc..afa1a90 100644
72 /* find the rotated file with the highest index */ 72 /* find the rotated file with the highest index */
73 static int findLastRotated(const struct logNames *rotNames, 73 static int findLastRotated(const struct logNames *rotNames,
74 const char *fileext, const char *compext) 74 const char *fileext, const char *compext)
75@@ -1911,15 +1958,15 @@ static int prerotateSingleLog(struct logInfo *log, int logNum, 75@@ -1958,15 +2005,15 @@ static int prerotateSingleLog(const struct logInfo *log, unsigned logNum,
76 } 76 }
77 77
78 message(MESS_DEBUG, 78 message(MESS_DEBUG,
@@ -91,7 +91,7 @@ index 25902bc..afa1a90 100644
91 oldName, newName, strerror(errno)); 91 oldName, newName, strerror(errno));
92 hasErrors = 1; 92 hasErrors = 1;
93 } 93 }
94@@ -2002,10 +2049,10 @@ static int rotateSingleLog(struct logInfo *log, int logNum, 94@@ -2051,10 +2098,10 @@ static int rotateSingleLog(const struct logInfo *log, unsigned logNum,
95 return 1; 95 return 1;
96 } 96 }
97 97
@@ -105,7 +105,7 @@ index 25902bc..afa1a90 100644
105 log->files[logNum], tmpFilename, 105 log->files[logNum], tmpFilename,
106 strerror(errno)); 106 strerror(errno));
107 hasErrors = 1; 107 hasErrors = 1;
108@@ -2014,11 +2061,11 @@ static int rotateSingleLog(struct logInfo *log, int logNum, 108@@ -2063,11 +2110,11 @@ static int rotateSingleLog(const struct logInfo *log, unsigned logNum,
109 free(tmpFilename); 109 free(tmpFilename);
110 } 110 }
111 else { 111 else {
@@ -120,7 +120,7 @@ index 25902bc..afa1a90 100644
120 log->files[logNum], rotNames->finalName, 120 log->files[logNum], rotNames->finalName,
121 strerror(errno)); 121 strerror(errno));
122 hasErrors = 1; 122 hasErrors = 1;
123@@ -2424,7 +2471,7 @@ static int rotateLogSet(struct logInfo *log, int force) 123@@ -2480,7 +2527,7 @@ static int rotateLogSet(const struct logInfo *log, int force)
124 return hasErrors; 124 return hasErrors;
125 } 125 }
126 126
@@ -129,16 +129,16 @@ index 25902bc..afa1a90 100644
129 { 129 {
130 struct logState *p; 130 struct logState *p;
131 FILE *f; 131 FILE *f;
132@@ -2629,7 +2676,7 @@ static int writeState(const char *stateFilename) 132@@ -2659,7 +2706,7 @@ static int writeState(const char *stateFilename)
133 fclose(f); 133 fclose(f);
134 134
135 if (error == 0) { 135 if (error == 0) {
136- if (rename(tmpFilename, stateFilename)) { 136- if (rename(tmpFilename, stateFilename)) {
137+ if (mvFile(tmpFilename, stateFilename, log, prev_acl)) { 137+ if (mvFile(tmpFilename, stateFilename, log, prev_acl)) {
138 message(MESS_ERROR, "error renaming temp state file %s to %s: %s\n",
139 tmpFilename, stateFilename, strerror(errno));
138 unlink(tmpFilename); 140 unlink(tmpFilename);
139 error = 1; 141@@ -3073,7 +3120,7 @@ int main(int argc, const char **argv)
140 message(MESS_ERROR, "error renaming temp state file %s to %s\n",
141@@ -2987,7 +3034,7 @@ int main(int argc, const char **argv)
142 rc |= rotateLogSet(log, force); 142 rc |= rotateLogSet(log, force);
143 143
144 if (!debug) 144 if (!debug)