aboutsummaryrefslogtreecommitdiff
path: root/init/init.c
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2001-10-24 05:00:29 +0000
committerEric Andersen <andersen@codepoet.org>2001-10-24 05:00:29 +0000
commitbdfd0d78bc44e73d693510e70087857785b3b521 (patch)
tree153a573095afac8d8d0ea857759ecabd77fb28b7 /init/init.c
parent9260fc5552a3ee52eb95823aa6689d52a1ffd33c (diff)
downloadbusybox-w32-bdfd0d78bc44e73d693510e70087857785b3b521.tar.gz
busybox-w32-bdfd0d78bc44e73d693510e70087857785b3b521.tar.bz2
busybox-w32-bdfd0d78bc44e73d693510e70087857785b3b521.zip
Major rework of the directory structure and the entire build system.
-Erik
Diffstat (limited to 'init/init.c')
-rw-r--r--init/init.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/init/init.c b/init/init.c
index 068e1df16..b6eaa46ea 100644
--- a/init/init.c
+++ b/init/init.c
@@ -43,7 +43,7 @@
43#include <sys/types.h> 43#include <sys/types.h>
44#include <sys/wait.h> 44#include <sys/wait.h>
45#include "busybox.h" 45#include "busybox.h"
46#ifdef BB_SYSLOGD 46#ifdef CONFIG_SYSLOGD
47# include <sys/syslog.h> 47# include <sys/syslog.h>
48#endif 48#endif
49 49
@@ -96,7 +96,7 @@ static const int RB_AUTOBOOT = 0x01234567;
96#endif 96#endif
97 97
98 98
99#if defined BB_FEATURE_INIT_COREDUMPS 99#if defined CONFIG_FEATURE_INIT_COREDUMPS
100/* 100/*
101 * When a file named CORE_ENABLE_FLAG_FILE exists, setrlimit is called 101 * When a file named CORE_ENABLE_FLAG_FILE exists, setrlimit is called
102 * before processes are spawned to set core file size as unlimited. 102 * before processes are spawned to set core file size as unlimited.
@@ -194,7 +194,7 @@ static void message(int device, char *fmt, ...)
194 va_list arguments; 194 va_list arguments;
195 int fd; 195 int fd;
196 196
197#ifdef BB_SYSLOGD 197#ifdef CONFIG_SYSLOGD
198 198
199 /* Log the message to syslogd */ 199 /* Log the message to syslogd */
200 if (device & LOG) { 200 if (device & LOG) {
@@ -546,7 +546,7 @@ static pid_t run(char *command, char *terminal, int get_enter)
546 getpid(), terminal, command); 546 getpid(), terminal, command);
547#endif 547#endif
548 548
549#if defined BB_FEATURE_INIT_COREDUMPS 549#if defined CONFIG_FEATURE_INIT_COREDUMPS
550 if (stat (CORE_ENABLE_FLAG_FILE, &sb) == 0) { 550 if (stat (CORE_ENABLE_FLAG_FILE, &sb) == 0) {
551 struct rlimit limit; 551 struct rlimit limit;
552 limit.rlim_cur = RLIM_INFINITY; 552 limit.rlim_cur = RLIM_INFINITY;
@@ -701,7 +701,7 @@ static void ctrlaltdel_signal(int sig)
701static void new_initAction(initActionEnum action, char *process, char *cons) 701static void new_initAction(initActionEnum action, char *process, char *cons)
702{ 702{
703 initAction *newAction; 703 initAction *newAction;
704#ifdef BB_FEATURE_INIT_NORMAL_ORDER 704#ifdef CONFIG_FEATURE_INIT_NORMAL_ORDER
705 initAction *a; 705 initAction *a;
706#endif 706#endif
707 707
@@ -723,7 +723,7 @@ static void new_initAction(initActionEnum action, char *process, char *cons)
723 message(LOG | CONSOLE, "Memory allocation failure\n"); 723 message(LOG | CONSOLE, "Memory allocation failure\n");
724 loop_forever(); 724 loop_forever();
725 } 725 }
726#ifdef BB_FEATURE_INIT_NORMAL_ORDER 726#ifdef CONFIG_FEATURE_INIT_NORMAL_ORDER
727 for (a = initActionList; a && a->nextPtr; a = a->nextPtr) ; 727 for (a = initActionList; a && a->nextPtr; a = a->nextPtr) ;
728 if (a) { 728 if (a) {
729 a->nextPtr = newAction; 729 a->nextPtr = newAction;
@@ -759,16 +759,16 @@ static void delete_initAction(initAction * action)
759 } 759 }
760} 760}
761 761
762/* NOTE that if BB_FEATURE_USE_INITTAB is NOT defined, 762/* NOTE that if CONFIG_FEATURE_USE_INITTAB is NOT defined,
763 * then parse_inittab() simply adds in some default 763 * then parse_inittab() simply adds in some default
764 * actions(i.e., runs INIT_SCRIPT and then starts a pair 764 * actions(i.e., runs INIT_SCRIPT and then starts a pair
765 * of "askfirst" shells). If BB_FEATURE_USE_INITTAB 765 * of "askfirst" shells). If CONFIG_FEATURE_USE_INITTAB
766 * _is_ defined, but /etc/inittab is missing, this 766 * _is_ defined, but /etc/inittab is missing, this
767 * results in the same set of default behaviors. 767 * results in the same set of default behaviors.
768 * */ 768 * */
769static void parse_inittab(void) 769static void parse_inittab(void)
770{ 770{
771#ifdef BB_FEATURE_USE_INITTAB 771#ifdef CONFIG_FEATURE_USE_INITTAB
772 FILE *file; 772 FILE *file;
773 char buf[256], lineAsRead[256], tmpConsole[256]; 773 char buf[256], lineAsRead[256], tmpConsole[256];
774 char *id, *runlev, *action, *process, *eol; 774 char *id, *runlev, *action, *process, *eol;
@@ -782,7 +782,7 @@ static void parse_inittab(void)
782#endif 782#endif
783 /* Reboot on Ctrl-Alt-Del */ 783 /* Reboot on Ctrl-Alt-Del */
784 new_initAction(CTRLALTDEL, "/sbin/reboot", console); 784 new_initAction(CTRLALTDEL, "/sbin/reboot", console);
785#ifdef BB_FEATURE_INIT_NORMAL_ORDER 785#ifdef CONFIG_FEATURE_INIT_NORMAL_ORDER
786 /* Umount all filesystems on halt/reboot */ 786 /* Umount all filesystems on halt/reboot */
787 new_initAction(SHUTDOWN, "/bin/umount -a -r", console); 787 new_initAction(SHUTDOWN, "/bin/umount -a -r", console);
788 /* Swapoff on halt/reboot */ 788 /* Swapoff on halt/reboot */
@@ -808,7 +808,7 @@ static void parse_inittab(void)
808 new_initAction(SYSINIT, INIT_SCRIPT, console); 808 new_initAction(SYSINIT, INIT_SCRIPT, console);
809 809
810 return; 810 return;
811#ifdef BB_FEATURE_USE_INITTAB 811#ifdef CONFIG_FEATURE_USE_INITTAB
812 } 812 }
813 813
814 while (fgets(buf, 255, file) != NULL) { 814 while (fgets(buf, 255, file) != NULL) {
@@ -880,7 +880,7 @@ static void parse_inittab(void)
880 } 880 }
881 } 881 }
882 return; 882 return;
883#endif /* BB_FEATURE_USE_INITTAB */ 883#endif /* CONFIG_FEATURE_USE_INITTAB */
884} 884}
885 885
886 886
@@ -894,7 +894,7 @@ extern int init_main(int argc, char **argv)
894#ifndef DEBUG_INIT 894#ifndef DEBUG_INIT
895 /* Expect to be invoked as init with PID=1 or be invoked as linuxrc */ 895 /* Expect to be invoked as init with PID=1 or be invoked as linuxrc */
896 if (getpid() != 1 896 if (getpid() != 1
897#ifdef BB_FEATURE_LINUXRC 897#ifdef CONFIG_FEATURE_INITRD
898 && strstr(applet_name, "linuxrc") == NULL 898 && strstr(applet_name, "linuxrc") == NULL
899#endif 899#endif
900 ) 900 )
@@ -933,14 +933,14 @@ extern int init_main(int argc, char **argv)
933 /* Hello world */ 933 /* Hello world */
934#ifndef DEBUG_INIT 934#ifndef DEBUG_INIT
935 message( 935 message(
936#if ! defined BB_FEATURE_EXTRA_QUIET 936#if ! defined CONFIG_FEATURE_EXTRA_QUIET
937 CONSOLE| 937 CONSOLE|
938#endif 938#endif
939 LOG, 939 LOG,
940 "init started: %s\r\n", full_version); 940 "init started: %s\r\n", full_version);
941#else 941#else
942 message( 942 message(
943#if ! defined BB_FEATURE_EXTRA_QUIET 943#if ! defined CONFIG_FEATURE_EXTRA_QUIET
944 CONSOLE| 944 CONSOLE|
945#endif 945#endif
946 LOG, 946 LOG,
@@ -966,7 +966,7 @@ extern int init_main(int argc, char **argv)
966 } else { 966 } else {
967 /* Not in single user mode -- see what inittab says */ 967 /* Not in single user mode -- see what inittab says */
968 968
969 /* NOTE that if BB_FEATURE_USE_INITTAB is NOT defined, 969 /* NOTE that if CONFIG_FEATURE_USE_INITTAB is NOT defined,
970 * then parse_inittab() simply adds in some default 970 * then parse_inittab() simply adds in some default
971 * actions(i.e., runs INIT_SCRIPT and then starts a pair 971 * actions(i.e., runs INIT_SCRIPT and then starts a pair
972 * of "askfirst" shells */ 972 * of "askfirst" shells */