summaryrefslogtreecommitdiff
path: root/init.c
diff options
context:
space:
mode:
authorErik Andersen2000-04-04 18:36:37 +0000
committerErik Andersen2000-04-04 18:36:37 +0000
commit183da4ade108945f94117a633045cfd6f4ff813a (patch)
tree9f65c953b3c408fe5b9867c16bb958258465b56e /init.c
parent983b51b17bb36e5b77cb160abdfbcf9d25675dd9 (diff)
downloadbusybox-183da4ade108945f94117a633045cfd6f4ff813a.zip
busybox-183da4ade108945f94117a633045cfd6f4ff813a.tar.gz
Minor structural change to allow core dumping(or not) from init
-Erik
Diffstat (limited to 'init.c')
-rw-r--r--init.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/init.c b/init.c
index f327a52..d61d1c3 100644
--- a/init.c
+++ b/init.c
@@ -55,13 +55,17 @@
#include <unistd.h>
+#if defined BB_FEATURE_INIT_COREDUMPS
/*
- * When CORE_ENABLE_FLAG_FILE exists, setrlimit is called before
- * process is spawned to set corelimit to unlimited.
+ * When a file named CORE_ENABLE_FLAG_FILE exists, setrlimit is called
+ * before processes are spawned to set core file size as unlimited.
+ * This is for debugging only. Don't use this is production, unless
+ * you want core dumps lying about....
*/
#define CORE_ENABLE_FLAG_FILE "/.init_enable_core"
#include <sys/resource.h>
#include <sys/time.h>
+#endif
#ifndef KERNEL_VERSION
#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)
cmd[i] = NULL;
}
+#if defined BB_FEATURE_INIT_COREDUMPS
{
struct stat sb;
if (stat (CORE_ENABLE_FLAG_FILE, &sb) == 0) {
@@ -424,6 +429,7 @@ static pid_t run(char *command, char *terminal, int get_enter)
setrlimit(RLIMIT_CORE, &limit);
}
}
+#endif
/* Now run it. The new program will take over this PID,
* so nothing further in init.c should be run. */