[BusyBox-cvs] CVS busybox/init
CVS User andersen
andersen at codepoet.org
Fri Oct 8 08:17:41 UTC 2004
Update of /var/cvs/busybox/init
In directory nail:/tmp/cvs-serv10353/init
Modified Files:
init.c
Log Message:
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.
--- /var/cvs/busybox/init/init.c 2004/08/16 09:29:42 1.204
+++ /var/cvs/busybox/init/init.c 2004/10/08 08:17:39 1.205
@@ -846,7 +846,7 @@
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')
cons = console;
@@ -864,16 +864,17 @@
}
/* 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 */
if ((strcmp(a->command, command) == 0) &&
(strcmp(a->terminal, cons) ==0)) {
free(new_action);
return;
}
+ last = a;
}
- if (a) {
- a->next = new_action;
+ if (last) {
+ last->next = new_action;
} else {
init_action_list = new_action;
}
More information about the busybox-cvs
mailing list