aboutsummaryrefslogtreecommitdiff
path: root/init
diff options
context:
space:
mode:
authorandersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277>2004-10-08 08:17:39 +0000
committerandersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277>2004-10-08 08:17:39 +0000
commitd77bf2fb62183eab3ee87f8ab8ace064a1b0beee (patch)
tree1eb90c4f50fe77b96351bf4d1fc9fb0e3a79df3a /init
parent9bdd61de68f365d788391753da28e97ad2af71a4 (diff)
downloadbusybox-w32-d77bf2fb62183eab3ee87f8ab8ace064a1b0beee.tar.gz
busybox-w32-d77bf2fb62183eab3ee87f8ab8ace064a1b0beee.tar.bz2
busybox-w32-d77bf2fb62183eab3ee87f8ab8ace064a1b0beee.zip
Hiroshi Ito writes:
"kill -HUP 1" reloads inittab, and when I append one line to inittab and send HUP signal two times, It will starts 2 process. patch against current CVS is attached. git-svn-id: svn://busybox.net/trunk/busybox@9326 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'init')
-rw-r--r--init/init.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/init/init.c b/init/init.c
index 2278e521f..8a63ff350 100644
--- a/init/init.c
+++ b/init/init.c
@@ -846,7 +846,7 @@ static void cont_handler(int sig)
846 846
847static void new_init_action(int action, const char *command, const char *cons) 847static void new_init_action(int action, const char *command, const char *cons)
848{ 848{
849 struct init_action *new_action, *a; 849 struct init_action *new_action, *a, *last;
850 850
851 if (*cons == '\0') 851 if (*cons == '\0')
852 cons = console; 852 cons = console;
@@ -864,16 +864,17 @@ static void new_init_action(int action, const char *command, const char *cons)
864 } 864 }
865 865
866 /* Append to the end of the list */ 866 /* Append to the end of the list */
867 for (a = init_action_list; a && a->next; a = a->next) { 867 for (a = last = init_action_list; a; a = a->next) {
868 /* don't enter action if it's already in the list */ 868 /* don't enter action if it's already in the list */
869 if ((strcmp(a->command, command) == 0) && 869 if ((strcmp(a->command, command) == 0) &&
870 (strcmp(a->terminal, cons) ==0)) { 870 (strcmp(a->terminal, cons) ==0)) {
871 free(new_action); 871 free(new_action);
872 return; 872 return;
873 } 873 }
874 last = a;
874 } 875 }
875 if (a) { 876 if (last) {
876 a->next = new_action; 877 last->next = new_action;
877 } else { 878 } else {
878 init_action_list = new_action; 879 init_action_list = new_action;
879 } 880 }