Diff

Differences From Artifact [1ccfa3a69d]:

To Artifact [ef0e023dd5]:


   226    226   	slots = malloc(sizeof(*slots) * numSlots);
   227    227   
   228    228   	chk_rv = C_GetSlotList(FALSE, slots, &numSlots);
   229    229   	if (chk_rv != CKR_OK) {
   230    230   		return(1);
   231    231   	}
   232    232   
          233  +	/* Test waiting for slot events */
   233    234   	currSlot = 0;
   234    235   	printf("Please insert a card now.\n");
          236  +
          237  +	/* Initially, every slot has changed state (but probably should not) */
          238  +	chk_rv = C_WaitForSlotEvent(0, &currSlot, NULL);
          239  +
          240  +	/* This actually waits */
   235    241   	chk_rv = C_WaitForSlotEvent(0, &currSlot, NULL);
   236    242   	if (chk_rv != CKR_OK) {
   237    243   		printf("Failed to wait for slot event.\n");
   238    244   	}
   239    245   
          246  +	/* This just ensures DONT_BLOCK works */
          247  +	chk_rv = C_WaitForSlotEvent(CKF_DONT_BLOCK, &currSlot, NULL);
          248  +
   240    249   	for (currSlot = 0; currSlot < numSlots; currSlot++) {
   241    250   		printf("  Slot %lu:\n", currSlot);
   242    251   
   243    252   		chk_rv = C_GetSlotInfo(slots[currSlot], &slotInfo);
   244    253   		if (chk_rv != CKR_OK) {
   245    254   			return(1);
   246    255   		}