Commit b82e609e authored by Jondy Zhao's avatar Jondy Zhao

logrotate: support cygwin

parent 7f382a26
......@@ -3,21 +3,19 @@ extends =
../popt/buildout.cfg
parts = logrotate
[logrotate-3.7.9-O_CLOEXEC.optional.patch]
recipe = hexagonit.recipe.download
url = ${:_profile_base_location_}/${:filename}
download-only = true
md5sum = 6beac248c978b767d4bccc1b7eebe6bd
filename = ${:_buildout_section_name_}
[logrotate]
recipe = slapos.recipe.cmmi
url = https://fedorahosted.org/releases/l/o/logrotate/logrotate-3.7.9.tar.gz
md5sum = eeba9dbca62a9210236f4b83195e4ea5
patch-options = -p1
patches =
${logrotate-3.7.9-O_CLOEXEC.optional.patch:location}/${logrotate-3.7.9-O_CLOEXEC.optional.patch:filename}
patches=
${:_profile_base_location_}/logrotate-3.7.9-O_CLOEXEC.optional.patch
configure-command = true
make-options = PREFIX=${buildout:parts-directory}/${:_buildout_section_name_}
environment =
POPT_DIR=${popt:location}/include -L${popt:location}/lib -Wl,-rpath=${popt:location}/lib
[logrotate:cygwin]
patches =
${logrotate:patches}
${:_profile_base_location_}/logrotate-3.7.9-cygwin.patch
diff --git a/config.c b/config.c
index e6d5d1d..a526d64 100644
--- a/config.c
+++ b/config.c
@@ -547,7 +547,7 @@ static int readConfigFile(const char *configFile, struct logInfo *defConfig)
length = sb.st_size;
buf = mmap(NULL, (size_t)(length + 2), PROT_READ | PROT_WRITE,
- MAP_PRIVATE | MAP_POPULATE, fd, (off_t) 0);
+ MAP_PRIVATE, fd, (off_t) 0);
if (buf == MAP_FAILED) {
message(MESS_ERROR, "Error mapping config file %s: %s\n",
configFile, strerror(errno));
@@ -559,7 +559,7 @@ static int readConfigFile(const char *configFile, struct logInfo *defConfig)
buf[length + 1] = '\0';
buf[length] = '\n';
madvise(buf, (size_t)(length + 2),
- MADV_SEQUENTIAL | MADV_WILLNEED | MADV_DONTFORK);
+ MADV_SEQUENTIAL | MADV_WILLNEED);
message(MESS_DEBUG, "reading config file %s\n", configFile);
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment