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.
This commit is contained in:
Eric Andersen 2004-10-08 08:17:39 +00:00
parent c00e11df85
commit 2271809d75

View File

@ -846,7 +846,7 @@ static void cont_handler(int sig)
static void new_init_action(int action, const char *command, const char *cons) static void new_init_action(int action, const char *command, const char *cons)
{ {
struct init_action *new_action, *a; struct init_action *new_action, *a, *last;
if (*cons == '\0') if (*cons == '\0')
cons = console; cons = console;
@ -864,16 +864,17 @@ static void new_init_action(int action, const char *command, const char *cons)
} }
/* Append to the end of the list */ /* Append to the end of the list */
for (a = init_action_list; a && a->next; a = a->next) { for (a = last = init_action_list; a; a = a->next) {
/* don't enter action if it's already in the list */ /* don't enter action if it's already in the list */
if ((strcmp(a->command, command) == 0) && if ((strcmp(a->command, command) == 0) &&
(strcmp(a->terminal, cons) ==0)) { (strcmp(a->terminal, cons) ==0)) {
free(new_action); free(new_action);
return; return;
} }
last = a;
} }
if (a) { if (last) {
a->next = new_action; last->next = new_action;
} else { } else {
init_action_list = new_action; init_action_list = new_action;
} }