]> Raphaƫl G. Git Repositories - ihttpd/blob - SOURCES/httpd-2.4.1-corelimit.patch
Redirect every requests on index.bin
[ihttpd] / SOURCES / httpd-2.4.1-corelimit.patch
1
2 Bump up the core size limit if CoreDumpDirectory is
3 configured.
4
5 Upstream-Status: Was discussed but there are competing desires;
6 there are portability oddities here too.
7
8 --- httpd-2.4.1/server/core.c.corelimit
9 +++ httpd-2.4.1/server/core.c
10 @@ -4433,6 +4433,25 @@ static int core_post_config(apr_pool_t *
11 }
12 apr_pool_cleanup_register(pconf, NULL, ap_mpm_end_gen_helper,
13 apr_pool_cleanup_null);
14 +
15 +#ifdef RLIMIT_CORE
16 + if (ap_coredumpdir_configured) {
17 + struct rlimit lim;
18 +
19 + if (getrlimit(RLIMIT_CORE, &lim) == 0 && lim.rlim_cur == 0) {
20 + lim.rlim_cur = lim.rlim_max;
21 + if (setrlimit(RLIMIT_CORE, &lim) == 0) {
22 + ap_log_error(APLOG_MARK, APLOG_NOTICE, 0, NULL,
23 + "core dump file size limit raised to %lu bytes",
24 + lim.rlim_cur);
25 + } else {
26 + ap_log_error(APLOG_MARK, APLOG_NOTICE, errno, NULL,
27 + "core dump file size is zero, setrlimit failed");
28 + }
29 + }
30 + }
31 +#endif
32 +
33 return OK;
34 }
35