diff options
author | Denis Vlasenko | 2009-02-26 11:57:01 +0000 |
---|---|---|
committer | Denis Vlasenko | 2009-02-26 11:57:01 +0000 |
commit | a76f10b544b4ffe4b0aaf41eede1aeb9b13a95e8 (patch) | |
tree | a41295eaee4b3f28a6e20df4e592ffacc42ac4ab /init/init.c | |
parent | 15c0b725849875c718b168a26e13872e163cde4c (diff) | |
download | busybox-a76f10b544b4ffe4b0aaf41eede1aeb9b13a95e8.zip busybox-a76f10b544b4ffe4b0aaf41eede1aeb9b13a95e8.tar.gz |
Apply post-1.13.2 fixes, bump version to 1.13.3
Diffstat (limited to 'init/init.c')
-rw-r--r-- | init/init.c | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/init/init.c b/init/init.c index 10f5ba6..5536504 100644 --- a/init/init.c +++ b/init/init.c @@ -671,15 +671,14 @@ static void new_init_action(uint8_t action_type, const char *command, const char */ static void parse_inittab(void) { +#if ENABLE_FEATURE_USE_INITTAB char *token[4]; - /* order must correspond to SYSINIT..RESTART constants */ - static const char actions[] ALIGN1 = - "sysinit\0""respawn\0""askfirst\0""wait\0""once\0" - "ctrlaltdel\0""shutdown\0""restart\0"; - - parser_t *parser = config_open2(INITTAB, fopen_for_read); - /* No inittab file -- set up some default behavior */ - if (parser == NULL) { + parser_t *parser = config_open2("/etc/inittab", fopen_for_read); + + if (parser == NULL) +#endif + { + /* No inittab file -- set up some default behavior */ /* Reboot on Ctrl-Alt-Del */ new_init_action(CTRLALTDEL, "reboot", ""); /* Umount all filesystems on halt/reboot */ @@ -699,11 +698,17 @@ static void parse_inittab(void) new_init_action(SYSINIT, INIT_SCRIPT, ""); return; } + +#if ENABLE_FEATURE_USE_INITTAB /* optional_tty:ignored_runlevel:action:command * Delims are not to be collapsed and need exactly 4 tokens */ while (config_read(parser, token, 4, 0, "#:", PARSE_NORMAL & ~(PARSE_TRIM | PARSE_COLLAPSE))) { + /* order must correspond to SYSINIT..RESTART constants */ + static const char actions[] ALIGN1 = + "sysinit\0""respawn\0""askfirst\0""wait\0""once\0" + "ctrlaltdel\0""shutdown\0""restart\0"; int action; char *tty = token[0]; @@ -727,6 +732,7 @@ static void parse_inittab(void) parser->lineno); } config_close(parser); +#endif } #if ENABLE_FEATURE_USE_INITTAB |