summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2009-05-12 14:49:57 -0700
committerMarcel Holtmann <marcel@holtmann.org>2009-05-12 14:49:57 -0700
commit6df988bd11d87a8a89832c611d36cd0319d2bd56 (patch)
treece6c6e929e5d380eb6332e47be953edd60635d72
parent6b32bd46caf32eb26d2706a7655ee66fe6639b3e (diff)
downloadconnman-6df988bd11d87a8a89832c611d36cd0319d2bd56.tar.gz
connman-6df988bd11d87a8a89832c611d36cd0319d2bd56.tar.bz2
connman-6df988bd11d87a8a89832c611d36cd0319d2bd56.zip
Store profile identifier assigned to service
-rw-r--r--src/service.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/service.c b/src/service.c
index ec09cc1c..f9fec502 100644
--- a/src/service.c
+++ b/src/service.c
@@ -45,6 +45,7 @@ struct connman_service {
unsigned int order;
char *name;
char *passphrase;
+ char *profile;
struct connman_device *device;
struct connman_network *network;
};
@@ -440,6 +441,7 @@ static void service_free(gpointer data)
if (service->network != NULL)
connman_network_unref(service->network);
+ g_free(service->profile);
g_free(service->name);
g_free(service->passphrase);
g_free(service->identifier);
@@ -693,6 +695,8 @@ struct connman_service *connman_service_get(const char *identifier)
service->identifier = g_strdup(identifier);
+ service->profile = g_strdup(__connman_profile_active_ident());
+
__connman_storage_load_service(service);
iter = g_sequence_insert_sorted(service_list, service,
@@ -988,6 +992,9 @@ static int service_load(struct connman_service *service)
{
DBG("service %p", service);
+ if (service->profile == NULL)
+ return -EINVAL;
+
return 0;
}
@@ -995,6 +1002,9 @@ static int service_save(struct connman_service *service)
{
DBG("service %p", service);
+ if (service->profile == NULL)
+ return -EINVAL;
+
return 0;
}