celix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pnol...@apache.org
Subject svn commit: r1600071 - /incubator/celix/trunk/framework/private/src/bundle_archive.c
Date Wed, 04 Jun 2014 09:51:21 GMT
Author: pnoltes
Date: Wed Jun  4 09:51:21 2014
New Revision: 1600071

URL: http://svn.apache.org/r1600071
Log:
CELIX-119: updated bundle_archive for updated linked_list

Modified:
    incubator/celix/trunk/framework/private/src/bundle_archive.c

Modified: incubator/celix/trunk/framework/private/src/bundle_archive.c
URL: http://svn.apache.org/viewvc/incubator/celix/trunk/framework/private/src/bundle_archive.c?rev=1600071&r1=1600070&r2=1600071&view=diff
==============================================================================
--- incubator/celix/trunk/framework/private/src/bundle_archive.c (original)
+++ incubator/celix/trunk/framework/private/src/bundle_archive.c Wed Jun  4 09:51:21 2014
@@ -71,7 +71,6 @@ celix_status_t bundleArchive_createSyste
     celix_status_t status = CELIX_SUCCESS;
     char *error = NULL;
 	bundle_archive_pt archive;
-	apr_pool_t *revisions_pool;
 
 	if (mp == NULL || *bundle_archive != NULL) {
 	    status = CELIX_ILLEGAL_ARGUMENT;
@@ -82,8 +81,7 @@ celix_status_t bundleArchive_createSyste
             status = CELIX_ENOMEM;
         } else {
         	apr_pool_pre_cleanup_register(mp, archive, bundleArchive_destroy);
-        	status = CELIX_DO_IF(status, apr_pool_create(&revisions_pool, mp));
-        	status = CELIX_DO_IF(status, linkedList_create(revisions_pool, &archive->revisions));
+        	status = linkedList_create(&archive->revisions);
         	if (status == CELIX_SUCCESS) {
                 archive->id = 0l;
                 archive->location = "System Bundle";
@@ -96,8 +94,6 @@ celix_status_t bundleArchive_createSyste
                 time(&archive->lastModified);
 
                 *bundle_archive = archive;
-            } else {
-                apr_pool_destroy(revisions_pool);
             }
         }
 	}
@@ -122,7 +118,7 @@ celix_status_t bundleArchive_create(fram
 		    status = CELIX_ENOMEM;
 		} else {
 			apr_pool_pre_cleanup_register(mp, archive, bundleArchive_destroy);
-			status = linkedList_create(&archive->revisions));
+			status = linkedList_create(&archive->revisions);
 			if (status == CELIX_SUCCESS) {
                 archive->id = id;
                 archive->location = location;
@@ -152,8 +148,9 @@ static apr_status_t bundleArchive_destro
     apr_status_t status = APR_SUCCESS;
 	bundle_archive_pt archive = archiveP;
 	archive = NULL;
+
 	if (archive->revisions != NULL) {
-		free(archive->revisions)
+		free(archive->revisions);
 	}
 
 	framework_logIfError(archive->logger, status, NULL, "Could not create archive");
@@ -165,7 +162,6 @@ celix_status_t bundleArchive_recreate(ch
     celix_status_t status = CELIX_SUCCESS;
     char *errpr = NULL;
 
-    apr_pool_t *revisions_pool;
     bundle_archive_pt archive;
 
 	archive = (bundle_archive_pt) apr_pcalloc(mp, sizeof(*archive));
@@ -174,8 +170,7 @@ celix_status_t bundleArchive_recreate(ch
  	} else {
         apr_dir_t *dir;
 		apr_pool_pre_cleanup_register(mp, archive, bundleArchive_destroy);
-		status = CELIX_DO_IF(status, apr_pool_create(&revisions_pool, mp));
-		status = CELIX_DO_IF(status, linkedList_create(revisions_pool, &archive->revisions));
+		status = linkedList_create(&archive->revisions);
 		if (status == CELIX_SUCCESS) {
             archive->archiveRoot = archiveRoot;
             apr_dir_open(&archive->archiveRootDir, archiveRoot, mp);
@@ -205,10 +200,6 @@ celix_status_t bundleArchive_recreate(ch
                 *bundle_archive = archive;
             }
 		}
-
-		if (status != CELIX_SUCCESS) {
-            apr_pool_destroy(revisions_pool);
-        }
 	}
 
 	framework_logIfError(archive->logger, status, NULL, "Could not create archive");



Mime
View raw message