summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2011-12-05 02:54:28 (GMT)
committer Denys Vlasenko <vda.linux@googlemail.com>2011-12-05 02:54:28 (GMT)
commitef7aa46bc4caa05e39458a47de02d0411e15f8d5 (patch)
tree4345633081bb214100e5de09ef0534b206cea6a7
parentbeb860ac758a5b08f4270da03a5f894f95816109 (diff)
downloadbusybox-ef7aa46bc4caa05e39458a47de02d0411e15f8d5.tar.gz
busybox-ef7aa46bc4caa05e39458a47de02d0411e15f8d5.tar.bz2
init: code shrink -4 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--init/init.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/init/init.c b/init/init.c
index 864ee6a..c540faa 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
*/
nextp = &init_action_list;
while ((a = *nextp) != NULL) {
- /* Don't enter action if it's already in the list,
+ /* Don't enter action if it's already in the list.
* This prevents losing running RESPAWNs.
*/
if (strcmp(a->command, command) == 0
@@ -610,14 +610,15 @@ static void new_init_action(uint8_t action_type, const char *command, const char
while (*nextp != NULL)
nextp = &(*nextp)->next;
a->next = NULL;
- break;
+ goto append;
}
nextp = &a->next;
}
- if (!a)
- a = xzalloc(sizeof(*a));
+ a = xzalloc(sizeof(*a));
+
/* Append to the end of the list */
+ append:
*nextp = a;
a->action_type = action_type;
safe_strncpy(a->command, command, sizeof(a->command));