From a2d1d9025f42d3d9205c7b4890f693e26d6d324d Mon Sep 17 00:00:00 2001 From: dimitri staessens Date: Tue, 23 Aug 2016 11:32:41 +0200 Subject: irm: Deprecate BIND_AP_LOC Location-dependent names should be managed by a higher-level NMS. --- include/ouroboros/irm_config.h | 1 - src/tools/irm/irm_bind_ap.c | 2 -- 2 files changed, 3 deletions(-) diff --git a/include/ouroboros/irm_config.h b/include/ouroboros/irm_config.h index f90ad927..d5f2b565 100644 --- a/include/ouroboros/irm_config.h +++ b/include/ouroboros/irm_config.h @@ -30,7 +30,6 @@ #define BIND_AP_AUTO 0x01 #define BIND_AP_UNIQUE 0x02 -#define BIND_AP_LOC 0x04 enum ipcp_type { IPCP_NORMAL = 0, diff --git a/src/tools/irm/irm_bind_ap.c b/src/tools/irm/irm_bind_ap.c index a525c077..189b197e 100644 --- a/src/tools/irm/irm_bind_ap.c +++ b/src/tools/irm/irm_bind_ap.c @@ -61,8 +61,6 @@ int do_bind_ap(int argc, char ** argv) flags |= BIND_AP_AUTO; } else if (strcmp(*argv, "unique") == 0) { flags |= BIND_AP_UNIQUE; - } else if (strcmp(*argv, "loc") == 0) { - flags |= BIND_AP_LOC; } else if (strcmp(*argv, "--") == 0) { ++argv; --argc; -- cgit v1.2.3 From 1b57e9ab5e26f7fbd2a5f1eb9c920ff4c93fad56 Mon Sep 17 00:00:00 2001 From: dimitri staessens Date: Tue, 23 Aug 2016 12:48:03 +0200 Subject: irmd: Fix cleaning dead AP-I The reg_entry_del_api must be called to correctly set the flow handling state instead of just clearing the entry from the list. --- src/irmd/main.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/irmd/main.c b/src/irmd/main.c index df93c75a..c33ba3e6 100644 --- a/src/irmd/main.c +++ b/src/irmd/main.c @@ -1693,8 +1693,7 @@ void * irm_sanitize() continue; LOG_DBG("Dead AP-I removed from: %d %s.", a->pid, e->name); - list_del(&a->next); - free(a); + reg_entry_del_api(e, a->pid); } } -- cgit v1.2.3 From c266a1e8609eb84e05acbd63b230777a4aa35977 Mon Sep 17 00:00:00 2001 From: dimitri staessens Date: Tue, 23 Aug 2016 13:23:41 +0200 Subject: irmd: Fix reaping child processes --- src/irmd/main.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/irmd/main.c b/src/irmd/main.c index c33ba3e6..5366b535 100644 --- a/src/irmd/main.c +++ b/src/irmd/main.c @@ -1286,15 +1286,16 @@ static pid_t auto_execute(char ** argv) return -1; } - LOG_INFO("Executing %s.", argv[0]); api = fork(); if (api == -1) { LOG_ERR("Failed to fork"); return api; } - if (api != 0) + if (api != 0) { + LOG_INFO("Instantiated %s as AP-i %d.", argv[0], api); return api; + } execv(argv[0], argv); @@ -1653,9 +1654,9 @@ void * irm_sanitize() list_for_each_safe(p, h, &irmd->spawned_apis) { struct pid_el * e = list_entry(p, struct pid_el, next); + waitpid(e->pid, &s, WNOHANG); if (kill(e->pid, 0) >= 0) continue; - waitpid(e->pid, &s, WNOHANG); LOG_DBG("Child process %d died, error %d.", e->pid, s); list_del(&e->next); free(e); -- cgit v1.2.3