rpms/logrotate/devel logrotate-3.7.2-cleanUp.patch, NONE, 1.1 logrotate.spec, 1.31, 1.32
fedora-cvs-commits at redhat.com
fedora-cvs-commits at redhat.com
Wed Oct 12 12:23:39 UTC 2005
Author: pvrabec
Update of /cvs/dist/rpms/logrotate/devel
In directory cvs.devel.redhat.com:/tmp/cvs-serv26782
Modified Files:
logrotate.spec
Added Files:
logrotate-3.7.2-cleanUp.patch
Log Message:
code clean up (#169885)
logrotate-3.7.2-cleanUp.patch:
config.c | 2 +-
logrotate.c | 46 ++++++++++------------------------------------
2 files changed, 11 insertions(+), 37 deletions(-)
--- NEW FILE logrotate-3.7.2-cleanUp.patch ---
--- logrotate-3.7.2/logrotate.c.cleanUp 2005-10-12 14:00:28.000000000 -0400
+++ logrotate-3.7.2/logrotate.c 2005-10-12 14:05:52.000000000 -0400
@@ -654,12 +654,11 @@
&& (((nowSecs - fst_buf.st_mtime)/60/60/24)
> log->rotateAge))) {
if ( mail_out != -1 ) {
- if (!hasErrors && log->logAddress) {
- char * mailFilename = (globResult.gl_pathv)[mail_out];
+ char * mailFilename = (globResult.gl_pathv)[mail_out];
+ if (!hasErrors && log->logAddress)
hasErrors = mailLogWrapper(mailFilename, mailCommand, logNum, log);
- if (!hasErrors)
- hasErrors = removeLogFile(mailFilename);
- }
+ if (!hasErrors)
+ hasErrors = removeLogFile(mailFilename);
}
mail_out = i;
}
@@ -689,11 +688,11 @@
struct stat fst_buf;
for (i=1; i <= rotateCount; i++) {
sprintf(oldName, "%s/%s.%d%s%s", rotNames->dirName, rotNames->baseName,
- rotateCount + 1, fileext, compext);
+ i, fileext, compext);
if(!stat(oldName,&fst_buf)
&& (((nowSecs - fst_buf.st_mtime)/60/60/24)
> log->rotateAge)) {
- char * mailFilename = (globResult.gl_pathv)[i];
+ char * mailFilename = oldName;
if (!hasErrors && log->logAddress)
hasErrors = mailLogWrapper(mailFilename, mailCommand, logNum, log);
if (!hasErrors)
@@ -893,8 +892,6 @@
if (!state->doRotate) return 0;
- if (!hasErrors) {
-
if ((log->flags & LOG_FLAG_COMPRESS) &&
!(log->flags & LOG_FLAG_DELAYCOMPRESS)) {
hasErrors = compressLogFile(rotNames->finalName, log, &state->sb);
@@ -908,35 +905,12 @@
else
mailFilename = rotNames->disposeName;
- if (mailFilename) {
- /* if the log is compressed (and we're not mailing a
- file whose compression has been delayed), we need
- to uncompress it */
- if ((log->flags & LOG_FLAG_COMPRESS) &&
- !((log->flags & LOG_FLAG_DELAYCOMPRESS) &&
- (log->flags & LOG_FLAG_MAILFIRST))) {
- if (mailLog(mailFilename, mailCommand,
- log->uncompress_prog, log->logAddress,
- log->files[logNum]))
- hasErrors = 1;
- } else {
- if (mailLog(mailFilename, mailCommand, NULL,
- log->logAddress, mailFilename))
- hasErrors = 1;
- }
- }
+ if (mailFilename)
+ hasErrors = mailLogWrapper(mailFilename, mailCommand, logNum, log);
}
- if (!hasErrors && rotNames->disposeName) {
- message(MESS_DEBUG, "removing old log %s\n", rotNames->disposeName);
-
- if (!debug && unlink(rotNames->disposeName)) {
- message(MESS_ERROR, "Failed to remove old log %s: %s\n",
- rotNames->disposeName, strerror(errno));
- hasErrors = 1;
- }
- }
- }
+ if (!hasErrors && rotNames->disposeName)
+ hasErrors = removeLogFile(rotNames->disposeName);
#ifdef WITH_SELINUX
if (selinux_enabled) {
--- logrotate-3.7.2/config.c.cleanUp 2005-10-12 14:00:03.000000000 -0400
+++ logrotate-3.7.2/config.c 2005-10-12 14:00:12.000000000 -0400
@@ -327,7 +327,7 @@
free_namelist(namelist, files_count);
return 1;
}
- };
+ }
fchdir(here);
close(here);
Index: logrotate.spec
===================================================================
RCS file: /cvs/dist/rpms/logrotate/devel/logrotate.spec,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -r1.31 -r1.32
--- logrotate.spec 10 Oct 2005 12:18:18 -0000 1.31
+++ logrotate.spec 12 Oct 2005 12:23:34 -0000 1.32
@@ -5,7 +5,7 @@
Summary: Rotates, compresses, removes and mails system log files.
Name: logrotate
Version: 3.7.2
-Release: 5
+Release: 6
License: GPL
Group: System Environment/Base
Source: logrotate-%{PACKAGE_VERSION}.tar.gz
@@ -14,6 +14,7 @@
Patch2: logrotate-3.7.2-sharedscript.patch
Patch3: logrotate-3.7.2-debugCompress.patch
Patch4: logrotate-3.7.2-fixLeaks.patch
+Patch5: logrotate-3.7.2-cleanUp.patch
%description
The logrotate utility is designed to simplify the administration of
@@ -32,6 +33,7 @@
%patch2 -p1 -b .sharedscript
%patch3 -p1 -b .debugCompress
%patch4 -p1 -b .fixLeaks
+%patch5 -p1 -b .cleanUp
%build
make RPM_OPT_FLAGS="$RPM_OPT_FLAGS -g" \
@@ -64,6 +66,9 @@
%attr(0644, root, root) %verify(not size md5 mtime) %config(noreplace) /var/lib/logrotate.status
%changelog
+* Wed Oct 12 2005 Peter Vrabec <pvrabec at redhat.com> 3.7.2-6
+- code clean up (#169885)
+
* Mon Oct 10 2005 Peter Vrabec <pvrabec at redhat.com> 3.7.2-5
- fix bug introduced in logrotate 3.7.2-3(#169858)
- fix some memory leaks (#169888)
More information about the fedora-cvs-commits
mailing list