Hi Henri,

On Thu, Feb 24, 2011 at 04:03:16PM +0200, Henri Bragge wrote:
> Service config should not be replaced after update.
> ---
>  src/config.c |    7 ++++++-
>  1 files changed, 6 insertions(+), 1 deletions(-)
> 
> diff --git a/src/config.c b/src/config.c
> index e4dfcd9..dcef4e5 100644
> --- a/src/config.c
> +++ b/src/config.c
> @@ -171,6 +171,7 @@ static int load_service(GKeyFile *keyfile, const char 
> *group,
>       struct connman_config_service *service;
>       const char *ident;
>       char *str, *hex_ssid;
> +     gboolean service_created = FALSE;
>  
>       /* Strip off "service_" prefix */
>       ident = group + 8;
> @@ -188,6 +189,8 @@ static int load_service(GKeyFile *keyfile, const char 
> *group,
>                       return -ENOMEM;
>  
>               service->ident = g_strdup(ident);
> +
> +             service_created = TRUE;
>       }
>  
>       str = g_key_file_get_string(keyfile, group, SERVICE_KEY_TYPE, NULL);
> @@ -297,7 +300,9 @@ static int load_service(GKeyFile *keyfile, const char 
> *group,
>               service->passphrase = str;
>       }
>  
> -     g_hash_table_replace(config->service_table, service->ident, service);
> +     if (service_created)
> +             g_hash_table_insert(config->service_table, service->ident,
> +                                     service);
So we wouldn't be able to update an already provisioned through D-Bus service?

Cheers,
Samuel.

-- 
Intel Open Source Technology Centre
http://oss.intel.com/
_______________________________________________
connman mailing list
connman@connman.net
http://lists.connman.net/listinfo/connman

Reply via email to