diff options
author | Sander Vrijders <[email protected]> | 2016-08-23 14:30:33 +0200 |
---|---|---|
committer | Sander Vrijders <[email protected]> | 2016-08-23 14:30:33 +0200 |
commit | 7c19363bc062efd52f54cc76a06685f9a9a757b5 (patch) | |
tree | eb5cf7a9fea4e1ec752410640c6ae6fceef27b5f | |
parent | f4c38f42f83c4a7df15b2351cb372f7638ae29ed (diff) | |
parent | c266a1e8609eb84e05acbd63b230777a4aa35977 (diff) | |
download | ouroboros-7c19363bc062efd52f54cc76a06685f9a9a757b5.tar.gz ouroboros-7c19363bc062efd52f54cc76a06685f9a9a757b5.zip |
Merged in dstaesse/ouroboros/be-bugfixing (pull request #218)
Various fixes
-rw-r--r-- | include/ouroboros/irm_config.h | 1 | ||||
-rw-r--r-- | src/irmd/main.c | 10 | ||||
-rw-r--r-- | src/tools/irm/irm_bind_ap.c | 2 |
3 files changed, 5 insertions, 8 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/irmd/main.c b/src/irmd/main.c index df93c75a..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); @@ -1693,8 +1694,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); } } 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; |