diff options
author | Eugene Tarassov | 2014-01-25 17:57:33 +0000 |
---|---|---|
committer | Eugene Tarassov | 2014-01-25 17:57:33 +0000 |
commit | cef5c99be43715a0267293f13c0bdee9294489e9 (patch) | |
tree | b0cb0ae4d6330b54e123698bdc75693c9fd6fc6c | |
parent | e26d177737f3829c04c7244d036f912ae309c407 (diff) | |
download | org.eclipse.tcf.agent-cef5c99be43715a0267293f13c0bdee9294489e9.tar.gz org.eclipse.tcf.agent-cef5c99be43715a0267293f13c0bdee9294489e9.tar.xz org.eclipse.tcf.agent-cef5c99be43715a0267293f13c0bdee9294489e9.zip |
TCF Agent: fixed: id2ctx() should return NULL if the context has exited
-rw-r--r-- | agent/tcf/framework/pid-hash.h | 2 | ||||
-rw-r--r-- | server/tcf/services/context-proxy.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/agent/tcf/framework/pid-hash.h b/agent/tcf/framework/pid-hash.h index 617c95fc..5ed8179c 100644 --- a/agent/tcf/framework/pid-hash.h +++ b/agent/tcf/framework/pid-hash.h @@ -52,7 +52,7 @@ Context * context_find_from_pid(pid_t pid, int thread) { if (l == NULL) return NULL; while (l != h) { Context * ctx = pidlink2ctx(l); - if (EXT(ctx)->pid == pid && + if (!ctx->exited && EXT(ctx)->pid == pid && (ctx->parent != NULL) == (thread != 0)) return ctx; l = l->next; } diff --git a/server/tcf/services/context-proxy.c b/server/tcf/services/context-proxy.c index 3697f104..eef72256 100644 --- a/server/tcf/services/context-proxy.c +++ b/server/tcf/services/context-proxy.c @@ -298,7 +298,7 @@ static ContextCache * find_context_cache(PeerCache * p, const char * id) { LINK * l = h->next; while (l != h) { ContextCache * c = idhashl2ctx(l); - if (strcmp(c->id, id) == 0) return c; + if (!c->ctx->exited && strcmp(c->id, id) == 0) return c; l = l->next; } return NULL; |