Store profile identifier assigned to service
authorMarcel Holtmann <marcel@holtmann.org>
Tue, 12 May 2009 21:49:57 +0000 (14:49 -0700)
committerMarcel Holtmann <marcel@holtmann.org>
Tue, 12 May 2009 21:49:57 +0000 (14:49 -0700)
src/service.c

index ec09cc1..f9fec50 100644 (file)
@@ -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;
 }