aboutsummaryrefslogtreecommitdiffhomepage
path: root/backends/maweb.c
diff options
context:
space:
mode:
Diffstat (limited to 'backends/maweb.c')
-rw-r--r--backends/maweb.c29
1 files changed, 4 insertions, 25 deletions
diff --git a/backends/maweb.c b/backends/maweb.c
index d008cc0..8cf201e 100644
--- a/backends/maweb.c
+++ b/backends/maweb.c
@@ -989,17 +989,10 @@ static int maweb_handle(size_t num, managed_fd* fds){
return rv;
}
-static int maweb_start(){
- size_t n, u, p;
- instance** inst = NULL;
+static int maweb_start(size_t n, instance** inst){
+ size_t u, p;
maweb_instance_data* data = NULL;
- //fetch all defined instances
- if(mm_backend_instances(BACKEND_NAME, &n, &inst)){
- fprintf(stderr, "Failed to fetch instance list\n");
- return 1;
- }
-
for(u = 0; u < n; u++){
//sort channels
data = (maweb_instance_data*) inst[u]->impl;
@@ -1017,11 +1010,6 @@ static int maweb_start(){
}
}
- free(inst);
- if(!n){
- return 0;
- }
-
fprintf(stderr, "maweb backend registering %" PRIsize_t " descriptors to core\n", n);
//initialize timeouts
@@ -1029,17 +1017,10 @@ static int maweb_start(){
return 0;
}
-static int maweb_shutdown(){
- size_t n, u;
- instance** inst = NULL;
+static int maweb_shutdown(size_t n, instance** inst){
+ size_t u;
maweb_instance_data* data = NULL;
- //fetch all instances
- if(mm_backend_instances(BACKEND_NAME, &n, &inst)){
- fprintf(stderr, "Failed to fetch instance list\n");
- return 1;
- }
-
for(u = 0; u < n; u++){
data = (maweb_instance_data*) inst[u]->impl;
free(data->host);
@@ -1065,8 +1046,6 @@ static int maweb_shutdown(){
data->channels = 0;
}
- free(inst);
-
fprintf(stderr, "maweb backend shut down\n");
return 0;
}