mturk / rpms / httpd

Forked from rpms/httpd 3 years ago
Clone
de17326
de17326
Bump up the core size limit if CoreDumpDirectory is
de17326
configured.
de17326
718c836
Upstream-Status: Was discussed but there are competing desires;
718c836
	there are portability oddities here too.
de17326
3a44ff7
--- httpd-2.4.1/server/core.c.corelimit
3a44ff7
+++ httpd-2.4.1/server/core.c
3a44ff7
@@ -4433,6 +4433,25 @@ static int core_post_config(apr_pool_t *
3a44ff7
     }
3a44ff7
     apr_pool_cleanup_register(pconf, NULL, ap_mpm_end_gen_helper,
3a44ff7
                               apr_pool_cleanup_null);
cvsdist 6356941
+
cvsdist 6356941
+#ifdef RLIMIT_CORE
cvsdist 6356941
+    if (ap_coredumpdir_configured) {
cvsdist 6356941
+        struct rlimit lim;
cvsdist 6356941
+
cvsdist 6356941
+        if (getrlimit(RLIMIT_CORE, &lim) == 0 && lim.rlim_cur == 0) {
cvsdist 6356941
+            lim.rlim_cur = lim.rlim_max;
cvsdist 6356941
+            if (setrlimit(RLIMIT_CORE, &lim) == 0) {
cvsdist 6356941
+                ap_log_error(APLOG_MARK, APLOG_NOTICE, 0, NULL,
cvsdist 6356941
+                             "core dump file size limit raised to %lu bytes",
cvsdist 6356941
+                             lim.rlim_cur);
cvsdist 6356941
+            } else {
cvsdist 6356941
+                ap_log_error(APLOG_MARK, APLOG_NOTICE, errno, NULL,
cvsdist 6356941
+                             "core dump file size is zero, setrlimit failed");
cvsdist 6356941
+            }
cvsdist 6356941
+        }
cvsdist 6356941
+    }
cvsdist 6356941
+#endif
cvsdist 6356941
+
cvsdist 6356941
     return OK;
cvsdist 6356941
 }
cvsdist 6356941