Hi,

On Thu, 2012-10-04 at 12:56 +0300, Jukka Rissanen wrote:
> ---
>  src/connman.h |  1 +
>  src/storage.c | 47 +++++++++++++++++++++++++++++++++++++++++++++++
>  2 files changed, 48 insertions(+)
> 
> diff --git a/src/connman.h b/src/connman.h
> index 8a33ba7..8a1a62c 100644
> --- a/src/connman.h
> +++ b/src/connman.h
> @@ -212,6 +212,7 @@ GKeyFile *__connman_storage_open_service(const char 
> *ident);
>  int __connman_storage_save_service(GKeyFile *keyfile, const char *ident);
>  GKeyFile *__connman_storage_load_provider(const char *identifier);
>  void __connman_storage_save_provider(GKeyFile *keyfile, const char 
> *identifier);
> +gboolean __connman_storage_remove_provider(const char *identifier);
>  char **__connman_storage_get_providers(void);
>  gboolean __connman_storage_remove_service(const char *service_id);
>  
> diff --git a/src/storage.c b/src/storage.c
> index 29291dc..54078fd 100644
> --- a/src/storage.c
> +++ b/src/storage.c
> @@ -372,6 +372,53 @@ void __connman_storage_save_provider(GKeyFile *keyfile, 
> const char *identifier)
>       g_free(pathname);
>  }
>  
> +static gboolean remove_dir_and_files(const char *id)
> +{
> +     gboolean removed;
> +
> +     removed = remove_file(id, SETTINGS);
> +     if (removed == FALSE)
> +             return FALSE;
> +
> +     /*
> +      * VPN dir does not have data file so do not check the
> +      * return value.
> +      */
> +     remove_file(id, "data");
> +
> +     removed = remove_dir(id);
> +     if (removed == FALSE)
> +             return FALSE;
> +
> +     return TRUE;
> +}

What about using the already existing 'remove_file()' and 'remove_dir()'
in storage.c?

Cheers,

        Patrik

_______________________________________________
connman mailing list
[email protected]
http://lists.connman.net/listinfo/connman

Reply via email to