PengZheng commented on code in PR #476:
URL: https://github.com/apache/celix/pull/476#discussion_r1114205474


##########
bundles/http_admin/http_admin/src/activator.c:
##########
@@ -52,7 +44,28 @@ typedef struct http_admin_activator {
 
 static int http_admin_start(http_admin_activator_t *act, 
celix_bundle_context_t *ctx) {
     celix_bundle_t *bundle = celix_bundleContext_getBundle(ctx);
-    char* root = celix_bundle_getEntry(bundle, "root");
+    char* storeRoot = celix_bundle_getDataFile(bundle, "");
+    if (storeRoot == NULL) {
+        celix_bundleContext_log(ctx, CELIX_LOG_LEVEL_ERROR, "Cannot get bundle 
store root for the http admin bundle.");
+        return CELIX_BUNDLE_EXCEPTION;
+    }
+
+    char* httpRoot = NULL;
+    int rc = asprintf(&httpRoot, "%s/root", storeRoot);
+    if (rc < 0) {
+        celix_bundleContext_log(ctx, CELIX_LOG_LEVEL_ERROR, "Cannot create 
http root directory for the http admin bundle.");
+        free(storeRoot);
+        return CELIX_ENOMEM;
+    }
+    free(storeRoot);
+
+    celix_status_t status = celix_utils_createDirectory(httpRoot, false, NULL);
+    if (status != CELIX_SUCCESS) {
+        celix_bundleContext_log(ctx, CELIX_LOG_LEVEL_ERROR, "Cannot create 
http root directory for the http admin bundle.");
+        free(httpRoot);
+        return CELIX_ENOMEM;

Review Comment:
   ```suggestion
           return status;
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@celix.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to