Changeset 3481 for branches/alonbl/pnp/src/libopensc/ctx.c
- Timestamp:
- 04/20/08 09:59:23 (9 months ago)
- Files:
-
- 1 modified
-
branches/alonbl/pnp/src/libopensc/ctx.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/alonbl/pnp/src/libopensc/ctx.c
r3405 r3481 355 355 /* verify module version */ 356 356 version = modversion(); 357 if (version == NULL || strncmp(version, "0.9.", strlen("0.9.")) > 0) { 357 /* XXX: We really need to have ABI version for each interface */ 358 if (version == NULL || strncmp(version, PACKAGE_VERSION, strlen(PACKAGE_VERSION)) != 0) { 358 359 sc_error(ctx,"dynamic library '%s': invalid module version\n",libname); 359 360 lt_dlclose(handle); … … 638 639 } 639 640 641 int sc_ctx_detect_readers(sc_context_t *ctx) 642 { 643 int i; 644 645 sc_mutex_lock(ctx, ctx->mutex); 646 647 for (i = 0; ctx->reader_drivers[i] != NULL; i++) { 648 const struct sc_reader_driver *drv = ctx->reader_drivers[i]; 649 650 if (drv->ops->detect_readers != NULL) 651 drv->ops->detect_readers(ctx, ctx->reader_drv_data[i]); 652 } 653 654 sc_mutex_unlock(ctx, ctx->mutex); 655 656 /* XXX: Do not ignore erros? */ 657 return SC_SUCCESS; 658 } 659 640 660 sc_reader_t *sc_ctx_get_reader(sc_context_t *ctx, unsigned int i) 641 661 { … … 725 745 del_drvs(&opts, 0); 726 746 del_drvs(&opts, 1); 727 if (ctx->reader_count == 0) { 728 sc_release_context(ctx); 729 return SC_ERROR_NO_READERS_FOUND; 730 } 747 sc_ctx_detect_readers(ctx); 731 748 *ctx_out = ctx; 732 749 return SC_SUCCESS;
