summaryrefslogtreecommitdiff
path: root/sapi
diff options
context:
space:
mode:
authorGeorge Wang <gwang@php.net>2008-09-21 02:34:08 +0000
committerGeorge Wang <gwang@php.net>2008-09-21 02:34:08 +0000
commit0f4f00e3ae7bdc0ef755412de1118c616cd8504d (patch)
treee0f88361bea6f25510c35a191493f130858719aa /sapi
parentf6b2e89ea68ebe1d68b759a1568f331a70a97938 (diff)
downloadphp-git-0f4f00e3ae7bdc0ef755412de1118c616cd8504d.tar.gz
disable core dump by default
Diffstat (limited to 'sapi')
-rw-r--r--sapi/litespeed/lsapilib.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/sapi/litespeed/lsapilib.c b/sapi/litespeed/lsapilib.c
index 145ed0a973..9092533a5c 100644
--- a/sapi/litespeed/lsapilib.c
+++ b/sapi/litespeed/lsapilib.c
@@ -66,7 +66,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <stdio.h>
#include <string.h>
#include <sys/mman.h>
+#include <sys/resource.h>
#include <sys/socket.h>
+#include <sys/time.h>
#include <sys/uio.h>
#include <sys/wait.h>
#include <time.h>
@@ -2120,7 +2122,16 @@ void LSAPI_Init_Env_Parameters( fn_select_t fp )
if ( p ) {
avoidFork = atoi( p );
}
-
+
+#if defined( RLIMIT_CORE )
+ p = getenv( "LSAPI_ALLOW_CORE_DUMP" );
+ if ( !p )
+ {
+ struct rlimit limit = { 0, 0 };
+ setrlimit( RLIMIT_CORE, &limit );
+ }
+#endif
+
p = getenv( "LSAPI_MAX_IDLE" );
if ( p ) {
n = atoi( p );