|
Lines 283-297
int main(int argc, char *argv[]) {
|
Link Here
|
|---|
|
return 1; | return 1; |
} | } |
| |
/* open pkcs11 sesion */ |
|
DBG("initialising pkcs #11 module..."); |
|
rv = ph.fl->C_Initialize(NULL); |
|
if (rv != 0) { |
|
release_pkcs11_module(&ph); |
|
DBG1("C_Initialize() failed: %d", rv); |
|
return 1; |
|
} |
|
|
|
/* put my self into background if flag is set */ | /* put my self into background if flag is set */ |
if (daemonize) { | if (daemonize) { |
DBG("Going to be daemon..."); | DBG("Going to be daemon..."); |
|
Lines 303-308
int main(int argc, char *argv[]) {
|
Link Here
|
|---|
|
} | } |
} | } |
| |
|
/* open pkcs11 sesion */ |
|
DBG("initialising pkcs #11 module..."); |
|
rv = ph.fl->C_Initialize(NULL); |
|
if (rv != 0) { |
|
release_pkcs11_module(&ph); |
|
if (ctx) scconf_free(ctx); |
|
DBG1("C_Initialize() failed: %d", rv); |
|
return 1; |
|
} |
|
ph.should_finalize = 1; |
|
|
/* | /* |
* Wait endlessly for all events in the list of readers | * Wait endlessly for all events in the list of readers |
* We only stop in case of an error | * We only stop in case of an error |
|
Lines 324-330
int main(int argc, char *argv[]) {
|
Link Here
|
|---|
|
new_state = get_a_token(); | new_state = get_a_token(); |
if (new_state == CARD_ERROR) { | if (new_state == CARD_ERROR) { |
DBG("Error trying to get a token"); | DBG("Error trying to get a token"); |
break; |
rv = ph.fl->C_Finalize(NULL); |
|
rv = ph.fl->C_Initialize(NULL); |
|
continue; |
} | } |
if (old_state == new_state ) { /* state unchanged */ | if (old_state == new_state ) { /* state unchanged */ |
/* on card not present, increase and check expire time */ | /* on card not present, increase and check expire time */ |