diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2009-02-26 11:57:01 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2009-02-26 11:57:01 +0000 |
commit | a76f10b544b4ffe4b0aaf41eede1aeb9b13a95e8 (patch) | |
tree | a41295eaee4b3f28a6e20df4e592ffacc42ac4ab /init | |
parent | 15c0b725849875c718b168a26e13872e163cde4c (diff) | |
download | busybox-w32-a76f10b544b4ffe4b0aaf41eede1aeb9b13a95e8.tar.gz busybox-w32-a76f10b544b4ffe4b0aaf41eede1aeb9b13a95e8.tar.bz2 busybox-w32-a76f10b544b4ffe4b0aaf41eede1aeb9b13a95e8.zip |
Apply post-1.13.2 fixes, bump version to 1.13.3
Diffstat (limited to 'init')
-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 10f5ba68d..553650411 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 | |||
671 | */ | 671 | */ |
672 | static void parse_inittab(void) | 672 | static void parse_inittab(void) |
673 | { | 673 | { |
674 | #if ENABLE_FEATURE_USE_INITTAB | ||
674 | char *token[4]; | 675 | char *token[4]; |
675 | /* order must correspond to SYSINIT..RESTART constants */ | 676 | parser_t *parser = config_open2("/etc/inittab", fopen_for_read); |
676 | static const char actions[] ALIGN1 = | 677 | |
677 | "sysinit\0""respawn\0""askfirst\0""wait\0""once\0" | 678 | if (parser == NULL) |
678 | "ctrlaltdel\0""shutdown\0""restart\0"; | 679 | #endif |
679 | 680 | { | |
680 | parser_t *parser = config_open2(INITTAB, fopen_for_read); | 681 | /* No inittab file -- set up some default behavior */ |
681 | /* No inittab file -- set up some default behavior */ | ||
682 | if (parser == NULL) { | ||
683 | /* Reboot on Ctrl-Alt-Del */ | 682 | /* Reboot on Ctrl-Alt-Del */ |
684 | new_init_action(CTRLALTDEL, "reboot", ""); | 683 | new_init_action(CTRLALTDEL, "reboot", ""); |
685 | /* Umount all filesystems on halt/reboot */ | 684 | /* Umount all filesystems on halt/reboot */ |
@@ -699,11 +698,17 @@ static void parse_inittab(void) | |||
699 | new_init_action(SYSINIT, INIT_SCRIPT, ""); | 698 | new_init_action(SYSINIT, INIT_SCRIPT, ""); |
700 | return; | 699 | return; |
701 | } | 700 | } |
701 | |||
702 | #if ENABLE_FEATURE_USE_INITTAB | ||
702 | /* optional_tty:ignored_runlevel:action:command | 703 | /* optional_tty:ignored_runlevel:action:command |
703 | * Delims are not to be collapsed and need exactly 4 tokens | 704 | * Delims are not to be collapsed and need exactly 4 tokens |
704 | */ | 705 | */ |
705 | while (config_read(parser, token, 4, 0, "#:", | 706 | while (config_read(parser, token, 4, 0, "#:", |
706 | PARSE_NORMAL & ~(PARSE_TRIM | PARSE_COLLAPSE))) { | 707 | PARSE_NORMAL & ~(PARSE_TRIM | PARSE_COLLAPSE))) { |
708 | /* order must correspond to SYSINIT..RESTART constants */ | ||
709 | static const char actions[] ALIGN1 = | ||
710 | "sysinit\0""respawn\0""askfirst\0""wait\0""once\0" | ||
711 | "ctrlaltdel\0""shutdown\0""restart\0"; | ||
707 | int action; | 712 | int action; |
708 | char *tty = token[0]; | 713 | char *tty = token[0]; |
709 | 714 | ||
@@ -727,6 +732,7 @@ static void parse_inittab(void) | |||
727 | parser->lineno); | 732 | parser->lineno); |
728 | } | 733 | } |
729 | config_close(parser); | 734 | config_close(parser); |
735 | #endif | ||
730 | } | 736 | } |
731 | 737 | ||
732 | #if ENABLE_FEATURE_USE_INITTAB | 738 | #if ENABLE_FEATURE_USE_INITTAB |