aboutsummaryrefslogtreecommitdiff
path: root/init
diff options
context:
space:
mode:
authorErik Andersen <andersen@codepoet.org>2000-04-04 18:36:37 +0000
committerErik Andersen <andersen@codepoet.org>2000-04-04 18:36:37 +0000
commit183da4ade108945f94117a633045cfd6f4ff813a (patch)
tree9f65c953b3c408fe5b9867c16bb958258465b56e /init
parent983b51b17bb36e5b77cb160abdfbcf9d25675dd9 (diff)
downloadbusybox-w32-183da4ade108945f94117a633045cfd6f4ff813a.tar.gz
busybox-w32-183da4ade108945f94117a633045cfd6f4ff813a.tar.bz2
busybox-w32-183da4ade108945f94117a633045cfd6f4ff813a.zip
Minor structural change to allow core dumping(or not) from init
-Erik
Diffstat (limited to 'init')
-rw-r--r--init/init.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/init/init.c b/init/init.c
index f327a52af..d61d1c38e 100644
--- a/init/init.c
+++ b/init/init.c
@@ -55,13 +55,17 @@
55#include <unistd.h> 55#include <unistd.h>
56 56
57 57
58#if defined BB_FEATURE_INIT_COREDUMPS
58/* 59/*
59 * When CORE_ENABLE_FLAG_FILE exists, setrlimit is called before 60 * When a file named CORE_ENABLE_FLAG_FILE exists, setrlimit is called
60 * process is spawned to set corelimit to unlimited. 61 * before processes are spawned to set core file size as unlimited.
62 * This is for debugging only. Don't use this is production, unless
63 * you want core dumps lying about....
61 */ 64 */
62#define CORE_ENABLE_FLAG_FILE "/.init_enable_core" 65#define CORE_ENABLE_FLAG_FILE "/.init_enable_core"
63#include <sys/resource.h> 66#include <sys/resource.h>
64#include <sys/time.h> 67#include <sys/time.h>
68#endif
65 69
66#ifndef KERNEL_VERSION 70#ifndef KERNEL_VERSION
67#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c)) 71#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))
@@ -415,6 +419,7 @@ static pid_t run(char *command, char *terminal, int get_enter)
415 cmd[i] = NULL; 419 cmd[i] = NULL;
416 } 420 }
417 421
422#if defined BB_FEATURE_INIT_COREDUMPS
418 { 423 {
419 struct stat sb; 424 struct stat sb;
420 if (stat (CORE_ENABLE_FLAG_FILE, &sb) == 0) { 425 if (stat (CORE_ENABLE_FLAG_FILE, &sb) == 0) {
@@ -424,6 +429,7 @@ static pid_t run(char *command, char *terminal, int get_enter)
424 setrlimit(RLIMIT_CORE, &limit); 429 setrlimit(RLIMIT_CORE, &limit);
425 } 430 }
426 } 431 }
432#endif
427 433
428 /* Now run it. The new program will take over this PID, 434 /* Now run it. The new program will take over this PID,
429 * so nothing further in init.c should be run. */ 435 * so nothing further in init.c should be run. */