summaryrefslogtreecommitdiff
path: root/vpn
diff options
context:
space:
mode:
authorPatrik Flykt <patrik.flykt@linux.intel.com>2013-05-29 13:21:14 (GMT)
committerPatrik Flykt <patrik.flykt@linux.intel.com>2013-05-30 07:29:28 (GMT)
commit58d55479c23f085cd2299e2133adef5c9d9c055b (patch)
treea3353fa39c4f2913ecefd17dc11c1965e513f837 /vpn
parent6619c13c23a05356f7c16d84e4c12d58d56366d1 (diff)
downloadconnman-58d55479c23f085cd2299e2133adef5c9d9c055b.zip
connman-58d55479c23f085cd2299e2133adef5c9d9c055b.tar.gz
connman-58d55479c23f085cd2299e2133adef5c9d9c055b.tar.bz2
vpn-config: Log a warning if the provider ident already exists
Also set the returned value appropriately when removing or adding configuration files.
Diffstat (limited to 'vpn')
-rw-r--r--vpn/vpn-config.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/vpn/vpn-config.c b/vpn/vpn-config.c
index b54fb1c..728b076 100644
--- a/vpn/vpn-config.c
+++ b/vpn/vpn-config.c
@@ -235,11 +235,16 @@ static int load_provider(GKeyFile *keyfile, const char *group,
struct vpn_provider *provider;
provider = __vpn_provider_lookup(id);
if (provider != NULL) {
- if (action == REMOVE)
+ if (action == REMOVE) {
__vpn_provider_delete(provider);
+ err = 0;
+ } else {
+ connman_warn("Provider configuration %s "
+ "already exist", id);
+ err = -EALREADY;
+ }
g_free(id);
- err = -EALREADY;
goto err;
}