From 440b4d33d71b19d0057e50ac61fa0b3127738479 Mon Sep 17 00:00:00 2001 From: dimitri staessens Date: Tue, 10 May 2016 11:32:59 +0200 Subject: irmd: introduced locking This commit adds locking to the IRMd with a single global lock. It also fixes some issues in cleaning up the daemon. --- src/lib/dev.c | 5 +++++ src/lib/ipcp.c | 2 -- 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'src/lib') diff --git a/src/lib/dev.c b/src/lib/dev.c index d574363b..c1cfe043 100644 --- a/src/lib/dev.c +++ b/src/lib/dev.c @@ -64,6 +64,7 @@ struct ap_data { int ap_init(char * ap_name) { + int i = 0; _ap_instance = malloc(sizeof(struct ap_data)); if (_ap_instance == NULL) { return -1; @@ -106,6 +107,10 @@ int ap_init(char * ap_name) return -1; } + for (i = 0; i < AP_MAX_FLOWS; ++i) + _ap_instance->flows[i].rb = NULL; + + return 0; } diff --git a/src/lib/ipcp.c b/src/lib/ipcp.c index 843582b9..1f1e5c99 100644 --- a/src/lib/ipcp.c +++ b/src/lib/ipcp.c @@ -148,8 +148,6 @@ pid_t ipcp_create(char * ipcp_name, strcat(full_name, exec_name); full_name[len] = '\0'; - LOG_DBG("Full name is %s", full_name); - char * argv[] = {full_name, irmd_pid, ipcp_name, -- cgit v1.2.3