]> TLD Linux GIT Repositories - packages/apache.git/blob - httpd-2.0.48-corelimit.patch
- mod_authn/z_core provide mod_authn/z_default to smooth upgrade
[packages/apache.git] / httpd-2.0.48-corelimit.patch
1
2 Automatically raise the core file size limit if CoreDumpDirectory
3 is configured.
4
5 --- httpd-2.4.1/server/core.c.orig      2012-02-22 00:09:24.000000000 +0100
6 +++ httpd-2.4.1/server/core.c   2012-02-22 00:15:07.329200901 +0100
7 @@ -4433,6 +4433,24 @@
8      }
9      apr_pool_cleanup_register(pconf, NULL, ap_mpm_end_gen_helper,
10                                apr_pool_cleanup_null);
11 +#ifdef RLIMIT_CORE
12 +    if (ap_coredumpdir_configured) {
13 +        struct rlimit lim;
14 +
15 +        if (getrlimit(RLIMIT_CORE, &lim) == 0 && lim.rlim_cur == 0) {
16 +            lim.rlim_cur = lim.rlim_max;
17 +            if (setrlimit(RLIMIT_CORE, &lim) == 0) {
18 +                ap_log_error(APLOG_MARK, APLOG_NOTICE, 0, NULL,
19 +                             "core dump file size limit raised to %lu bytes",
20 +                             lim.rlim_cur);
21 +            } else {
22 +                ap_log_error(APLOG_MARK, APLOG_NOTICE, errno, NULL,
23 +                             "core dump file size is zero, setrlimit failed");
24 +            }
25 +        }
26 +    }
27 +#endif
28 +
29      return OK;
30  }
31