aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStéphane Desneux <stephane.desneux@iot.bzh>2019-10-17 13:41:13 +0000
committerGerrit Code Review <gerrit@automotivelinux.org>2019-10-17 13:41:13 +0000
commita45ec9e85415bbc24f3950cf5a41cfc69bce30b9 (patch)
tree24b6615afc8a5b6b88b27279614a5d60a0fa0aed
parent9a5cf5c9e14b27b05277e2812901e039c8a0b52f (diff)
parentf540130618e106d79b5eef0ef548d761a4585632 (diff)
Merge "Unmanage all halmap before deleting hal api"
-rw-r--r--src/4a-internals-hal/4a-internals-hal-api-loader.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/4a-internals-hal/4a-internals-hal-api-loader.c b/src/4a-internals-hal/4a-internals-hal-api-loader.c
index c833521..a8b62c6 100644
--- a/src/4a-internals-hal/4a-internals-hal-api-loader.c
+++ b/src/4a-internals-hal/4a-internals-hal-api-loader.c
@@ -210,10 +210,21 @@ int InternalHalDeleteApi(afb_api_t apiHandle, struct cds_list_head *halDataListH
return -1;
}
+ err = InternalHalUnmanageAllHalMap(toDeleteHalData->internalHalData->apiHandle,
+ &toDeleteHalData->internalHalData->halMapListHead,
+ &toDeleteHalData->internalHalData->probedDevicesListHead);
+ if(err) {
+ AFB_API_ERROR(apiHandle,
+ "Error %i happened while trying to unmanage all halmap of '%s' hal api",
+ err,
+ toDeleteHalData->apiName);
+ return -2;
+ }
+
toDeleteApiName = strdup(toDeleteHalData->apiName);
if(! toDeleteApiName) {
AFB_API_ERROR(apiHandle, "Didn't succeed to store (allocate) 'apiName' string");
- return -2;
+ return -3;
}
err = HalUtlRemoveHalDataAndDeleteHalApi(toDeleteHalData->internalHalData->apiHandle,
@@ -225,7 +236,7 @@ int InternalHalDeleteApi(afb_api_t apiHandle, struct cds_list_head *halDataListH
err,
toDeleteApiName);
free(toDeleteApiName);
- return -3;
+ return -4;
}
AFB_API_NOTICE(apiHandle,