41 lines
1.3 KiB
Diff
41 lines
1.3 KiB
Diff
|
diff -up logrotate-3.7.6/logrotate.c.fdclose logrotate-3.7.6/logrotate.c
|
||
|
--- logrotate-3.7.6/logrotate.c.fdclose 2008-04-21 11:49:57.000000000 +0200
|
||
|
+++ logrotate-3.7.6/logrotate.c 2008-04-21 11:53:08.000000000 +0200
|
||
|
@@ -935,6 +935,9 @@ int rotateSingleLog(logInfo * log, int l
|
||
|
if (oldContext != NULL) {
|
||
|
freecon(oldContext);
|
||
|
}
|
||
|
+ if (close(fdcurr) < 0)
|
||
|
+ message(MESS_ERROR, "error closing file %s",
|
||
|
+ log->files[logNum]);
|
||
|
return 1;
|
||
|
}
|
||
|
}
|
||
|
@@ -946,6 +949,9 @@ int rotateSingleLog(logInfo * log, int l
|
||
|
if (oldContext != NULL) {
|
||
|
freecon(oldContext);
|
||
|
}
|
||
|
+ if (close(fdcurr) < 0)
|
||
|
+ message(MESS_ERROR, "error closing file %s",
|
||
|
+ log->files[logNum]);
|
||
|
return 1;
|
||
|
}
|
||
|
}
|
||
|
@@ -959,10 +965,16 @@ int rotateSingleLog(logInfo * log, int l
|
||
|
message(MESS_ERROR, "getting file context %s: %s\n",
|
||
|
log->files[logNum], strerror(errno));
|
||
|
if (selinux_enforce) {
|
||
|
+ if (close(fdcurr) < 0)
|
||
|
+ message(MESS_ERROR, "error closing file %s",
|
||
|
+ log->files[logNum]);
|
||
|
return 1;
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
+ if (close(fdcurr) < 0)
|
||
|
+ message(MESS_ERROR, "error closing file %s",
|
||
|
+ log->files[logNum]);
|
||
|
}
|
||
|
#endif
|
||
|
message(MESS_DEBUG, "renaming %s to %s\n", log->files[logNum],
|