Author: abroekhuis
Date: Mon Aug 25 18:38:47 2014
New Revision: 1620408

URL: http://svn.apache.org/r1620408
Log:
Fixed some small issues

Modified:
    celix/trunk/framework/private/src/framework.c
    celix/trunk/framework/private/src/service_registry.c
    
celix/trunk/remote_services/discovery_configured/private/src/discovery_activator.c
    celix/trunk/remote_services/topology_manager/private/src/activator.c
    celix/trunk/remote_services/topology_manager/private/src/topology_manager.c

Modified: celix/trunk/framework/private/src/framework.c
URL: 
http://svn.apache.org/viewvc/celix/trunk/framework/private/src/framework.c?rev=1620408&r1=1620407&r2=1620408&view=diff
==============================================================================
--- celix/trunk/framework/private/src/framework.c (original)
+++ celix/trunk/framework/private/src/framework.c Mon Aug 25 18:38:47 2014
@@ -1253,7 +1253,6 @@ celix_status_t fw_registerService(framew
                     hook->added(hook->handle, infos);
                 }
                 status = CELIX_DO_IF(status, 
serviceRegistry_ungetService(framework->registry, framework->bundle, ref, 
&ungetResult));
-                status = CELIX_DO_IF(status, 
serviceRegistry_removeReference(ref));  //NOTE: should this not be done in the 
serviceRegistry_ungetService??
 
                 int i = 0;
                 for (i = 0; i < arrayList_size(infos); i++) {

Modified: celix/trunk/framework/private/src/service_registry.c
URL: 
http://svn.apache.org/viewvc/celix/trunk/framework/private/src/service_registry.c?rev=1620408&r1=1620407&r2=1620408&view=diff
==============================================================================
--- celix/trunk/framework/private/src/service_registry.c (original)
+++ celix/trunk/framework/private/src/service_registry.c Mon Aug 25 18:38:47 
2014
@@ -444,6 +444,7 @@ celix_status_t serviceRegistry_ungetServ
 
        usage->count--;
 
+       serviceRegistry_removeReference(reference);
 
        if ((serviceRegistration_isValid(registration)) || (usage->count <= 0)) 
{
                usage->service = NULL;

Modified: 
celix/trunk/remote_services/discovery_configured/private/src/discovery_activator.c
URL: 
http://svn.apache.org/viewvc/celix/trunk/remote_services/discovery_configured/private/src/discovery_activator.c?rev=1620408&r1=1620407&r2=1620408&view=diff
==============================================================================
--- 
celix/trunk/remote_services/discovery_configured/private/src/discovery_activator.c
 (original)
+++ 
celix/trunk/remote_services/discovery_configured/private/src/discovery_activator.c
 Mon Aug 25 18:38:47 2014
@@ -101,8 +101,7 @@ celix_status_t bundleActivator_start(voi
                return CELIX_ENOMEM;
        }
 
-       sprintf(scope, "(&(%s=*)(%s=%s))", OSGI_FRAMEWORK_OBJECTCLASS, 
OSGI_RSA_ENDPOINT_FRAMEWORK_UUID, uuid);
-       scope[len] = 0;
+       snprintf(scope, len, "(&(%s=*)(%s=%s))", OSGI_FRAMEWORK_OBJECTCLASS, 
OSGI_RSA_ENDPOINT_FRAMEWORK_UUID, uuid);
 
        printf("DISCOVERY_CONFIGURED: using scope %s.\n", scope);
 

Modified: celix/trunk/remote_services/topology_manager/private/src/activator.c
URL: 
http://svn.apache.org/viewvc/celix/trunk/remote_services/topology_manager/private/src/activator.c?rev=1620408&r1=1620407&r2=1620408&view=diff
==============================================================================
--- celix/trunk/remote_services/topology_manager/private/src/activator.c 
(original)
+++ celix/trunk/remote_services/topology_manager/private/src/activator.c Mon 
Aug 25 18:38:47 2014
@@ -100,7 +100,7 @@ static celix_status_t bundleActivator_cr
 static celix_status_t bundleActivator_createServiceListener(struct activator 
*activator, service_listener_pt *listener) {
        celix_status_t status = CELIX_SUCCESS;
 
-       *listener = malloc(sizeof(*listener));
+       *listener = malloc(sizeof(**listener));
        if (!*listener) {
                return CELIX_ENOMEM;
        }
@@ -133,8 +133,7 @@ celix_status_t bundleActivator_start(voi
                return CELIX_ENOMEM;
        }
 
-       sprintf(scope, "(&(%s=*)(!(%s=%s)))", OSGI_FRAMEWORK_OBJECTCLASS, 
OSGI_RSA_ENDPOINT_FRAMEWORK_UUID, uuid);
-       scope[len] = 0;
+       snprintf(scope, 14, "(&(%s=*)(!(%s=%s)))", OSGI_FRAMEWORK_OBJECTCLASS, 
OSGI_RSA_ENDPOINT_FRAMEWORK_UUID, uuid);
 
        printf("TOPOLOGY_MANAGER: endpoint listener scope is %s\n", scope);
 

Modified: 
celix/trunk/remote_services/topology_manager/private/src/topology_manager.c
URL: 
http://svn.apache.org/viewvc/celix/trunk/remote_services/topology_manager/private/src/topology_manager.c?rev=1620408&r1=1620407&r2=1620408&view=diff
==============================================================================
--- celix/trunk/remote_services/topology_manager/private/src/topology_manager.c 
(original)
+++ celix/trunk/remote_services/topology_manager/private/src/topology_manager.c 
Mon Aug 25 18:38:47 2014
@@ -469,8 +469,7 @@ celix_status_t topologyManager_extendFil
                return CELIX_ENOMEM;
        }
 
-       sprintf(*updatedFilter, "(&%s(!(%s=%s)))", filter, 
OSGI_RSA_ENDPOINT_FRAMEWORK_UUID, uuid);
-       (*updatedFilter)[len] = 0;
+       snprintf(*updatedFilter, len, "(&%s(!(%s=%s)))", filter, 
OSGI_RSA_ENDPOINT_FRAMEWORK_UUID, uuid);
 
        return status;
 }


Reply via email to