From 328d8a4b0235434c8707e749004b260c419879b3 Mon Sep 17 00:00:00 2001 From: Samuel Ortiz Date: Fri, 8 Apr 2011 17:44:01 +0200 Subject: [PATCH] config: Avoid create_config forward declaration --- src/config.c | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/src/config.c b/src/config.c index 17ed7d1..22a4704 100644 --- a/src/config.c +++ b/src/config.c @@ -317,22 +317,6 @@ static int load_service(GKeyFile *keyfile, const char *group, return 0; } -static struct connman_config *create_config(const char *ident); - -int __connman_config_load_service(GKeyFile *keyfile, const char *group) -{ - struct connman_config *config = g_hash_table_lookup(config_table, - NONFS_CONFIG_NAME); - - if (config == NULL) { - config = create_config(NONFS_CONFIG_NAME); - if (config == NULL) - return -ENOMEM; - } - - return load_service(keyfile, group, config); -} - static int load_config(struct connman_config *config) { GKeyFile *keyfile; @@ -401,6 +385,20 @@ static struct connman_config *create_config(const char *ident) return config; } +int __connman_config_load_service(GKeyFile *keyfile, const char *group) +{ + struct connman_config *config = g_hash_table_lookup(config_table, + NONFS_CONFIG_NAME); + + if (config == NULL) { + config = create_config(NONFS_CONFIG_NAME); + if (config == NULL) + return -ENOMEM; + } + + return load_service(keyfile, group, config); +} + static int read_configs(void) { GDir *dir; -- 2.7.4