1
Preserve mtime/atime on compression. (Closes: #286957)
3
--- ./logrotate.c 2005-09-03 14:07:42.000000000 +0100
4
+++ /tmp/dpep-work.m2M7hf/logrotate-3.7.1/logrotate.c 2005-09-03 14:08:14.000000000 +0100
9
+#include <sys/types.h>
13
#include <selinux/selinux.h>
15
static int compressLogFile(char * name, logInfo * log, struct stat *sb) {
16
char * compressedName;
17
const char ** fullCommand;
18
+ struct utimbuf utim;
23
message(MESS_ERROR, "failed to compress log %s\n", name);
27
+ utim.actime = sb->st_atime;
28
+ utim.modtime = sb->st_mtime;
29
+ utime(compressedName,&utim);
30
+ /* If we can't change atime/mtime, it's not a disaster.
31
+ It might possibly fail under SELinux. */