diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2011-12-05 03:54:28 +0100 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2011-12-05 03:54:28 +0100 |
commit | ef7aa46bc4caa05e39458a47de02d0411e15f8d5 (patch) | |
tree | 4345633081bb214100e5de09ef0534b206cea6a7 /init | |
parent | beb860ac758a5b08f4270da03a5f894f95816109 (diff) | |
download | busybox-w32-ef7aa46bc4caa05e39458a47de02d0411e15f8d5.tar.gz busybox-w32-ef7aa46bc4caa05e39458a47de02d0411e15f8d5.tar.bz2 busybox-w32-ef7aa46bc4caa05e39458a47de02d0411e15f8d5.zip |
init: code shrink -4 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'init')
-rw-r--r-- | init/init.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/init/init.c b/init/init.c index 864ee6ab8..c540faa70 100644 --- a/init/init.c +++ b/init/init.c | |||
@@ -598,7 +598,7 @@ static void new_init_action(uint8_t action_type, const char *command, const char | |||
598 | */ | 598 | */ |
599 | nextp = &init_action_list; | 599 | nextp = &init_action_list; |
600 | while ((a = *nextp) != NULL) { | 600 | while ((a = *nextp) != NULL) { |
601 | /* Don't enter action if it's already in the list, | 601 | /* Don't enter action if it's already in the list. |
602 | * This prevents losing running RESPAWNs. | 602 | * This prevents losing running RESPAWNs. |
603 | */ | 603 | */ |
604 | if (strcmp(a->command, command) == 0 | 604 | if (strcmp(a->command, command) == 0 |
@@ -610,14 +610,15 @@ static void new_init_action(uint8_t action_type, const char *command, const char | |||
610 | while (*nextp != NULL) | 610 | while (*nextp != NULL) |
611 | nextp = &(*nextp)->next; | 611 | nextp = &(*nextp)->next; |
612 | a->next = NULL; | 612 | a->next = NULL; |
613 | break; | 613 | goto append; |
614 | } | 614 | } |
615 | nextp = &a->next; | 615 | nextp = &a->next; |
616 | } | 616 | } |
617 | 617 | ||
618 | if (!a) | 618 | a = xzalloc(sizeof(*a)); |
619 | a = xzalloc(sizeof(*a)); | 619 | |
620 | /* Append to the end of the list */ | 620 | /* Append to the end of the list */ |
621 | append: | ||
621 | *nextp = a; | 622 | *nextp = a; |
622 | a->action_type = action_type; | 623 | a->action_type = action_type; |
623 | safe_strncpy(a->command, command, sizeof(a->command)); | 624 | safe_strncpy(a->command, command, sizeof(a->command)); |