logrotate-3.7.9-O_CLOEXEC.optional.patch 521 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
diff --git a/config.c b/config.c
index e6d5d1d..dd004a9 100644
--- a/config.c
+++ b/config.c
@@ -519,7 +519,11 @@ static int readConfigFile(const char *configFile, struct logInfo *defConfig)
        length arrays -- of course, if we aren't run setuid it doesn't
        matter much */
 
+#ifdef O_CLOEXEC
     fd = open(configFile, O_RDONLY | O_CLOEXEC);
+#else
+    fd = open(configFile, O_RDONLY);
+#endif
     if (fd < 0) {
 	message(MESS_ERROR, "failed to open config file %s: %s\n",
 		configFile, strerror(errno));