From: Marcus Brinkmann Date: Thu, 14 Apr 2005 08:49:20 +0000 (+0000) Subject: 2005-04-14 Marcus Brinkmann X-Git-Tag: gpgme-1-1-0~46 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=34f97998390b7be1febbb436f01482984062d7d6;p=gpgme.git 2005-04-14 Marcus Brinkmann * wait-global.c (gpgme_wait): Use LI->ctx when checking a context in the list, not the user-provided CTX. --- diff --git a/gpgme/ChangeLog b/gpgme/ChangeLog index d993d47..ba448ef 100644 --- a/gpgme/ChangeLog +++ b/gpgme/ChangeLog @@ -1,5 +1,9 @@ 2005-04-14 Marcus Brinkmann + * wait-global.c (gpgme_wait): Use LI->ctx when checking a context + in the list, not the user-provided CTX. + Reported by Igor Belyi . + * wait-global.c (gpgme_wait): If no context is found, and we should not hang, set *status to 0 and return NULL. Reported by Igor Belyi . diff --git a/gpgme/wait-global.c b/gpgme/wait-global.c index 24d7550..db422bf 100644 --- a/gpgme/wait-global.c +++ b/gpgme/wait-global.c @@ -331,13 +331,15 @@ gpgme_wait (gpgme_ctx_t ctx, gpgme_error_t *status, int hang) LOCK (ctx_list_lock); for (li = ctx_active_list; li; li = li->next) { - for (i = 0; i < ctx->fdt.size; i++) - if (ctx->fdt.fds[i].fd != -1) + gpgme_ctx_t actx = li->ctx; + + for (i = 0; i < actx->fdt.size; i++) + if (actx->fdt.fds[i].fd != -1) break; - if (i == ctx->fdt.size) + if (i == actx->fdt.size) { gpgme_error_t err = 0; - _gpgme_engine_io_event (ctx->engine, GPGME_EVENT_DONE, &err); + _gpgme_engine_io_event (actx->engine, GPGME_EVENT_DONE, &err); } } UNLOCK (ctx_list_lock);