aboutsummaryrefslogtreecommitdiffhomepage
path: root/backend.c
diff options
context:
space:
mode:
Diffstat (limited to 'backend.c')
-rw-r--r--backend.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/backend.c b/backend.c
index e1e143f..673fe9b 100644
--- a/backend.c
+++ b/backend.c
@@ -15,21 +15,21 @@ backend* backend_match(char* name){
return NULL;
}
-backend* mm_backend_register(backend b){
+int mm_backend_register(backend b){
if(!backend_match(b.name)){
backends = realloc(backends, (nbackends + 1) * sizeof(backend));
if(!backends){
fprintf(stderr, "Failed to allocate memory\n");
nbackends = 0;
- return NULL;
+ return 1;
}
backends[nbackends] = b;
nbackends++;
fprintf(stderr, "Registered backend %s\n", b.name);
- return backends + (nbackends - 1);
+ return 0;
}
- return NULL;
+ return 1;
}
int backends_stop(){