summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Levy <alevy@redhat.com>2011-01-08 10:51:28 +0200
committerAlon Levy <alevy@redhat.com>2011-01-08 14:44:36 +0200
commit325c5048dca29fd0c645de9d5a4b600cffa999a8 (patch)
tree31ba39a3b1734a90943d0984d285ac75d555644b
parent244804c976f5c89864c6e93322855c52408c4e0e (diff)
vcard_emul,vcard_emul_nss: add VCARD_EMUL_INIT_ALREADY_INITED
-rw-r--r--vcard_emul.h4
-rw-r--r--vcard_emul_nss.c6
2 files changed, 9 insertions, 1 deletions
diff --git a/vcard_emul.h b/vcard_emul.h
index 1df1215..5df01a8 100644
--- a/vcard_emul.h
+++ b/vcard_emul.h
@@ -19,7 +19,9 @@
*/
typedef enum {
VCARD_EMUL_OK =0,
- VCARD_EMUL_FAIL
+ VCARD_EMUL_FAIL,
+ // return values by vcard_emul_init
+ VCARD_EMUL_INIT_ALREADY_INITED,
} VCardEmulError;
/* options are emul specific. call card_emul_parse_args to change a string
diff --git a/vcard_emul_nss.c b/vcard_emul_nss.c
index aea487c..33404c2 100644
--- a/vcard_emul_nss.c
+++ b/vcard_emul_nss.c
@@ -724,6 +724,8 @@ vcard_emul_force_card_insert(VReader *vreader)
* recognized later. So Instead return FAIL only if no_hw==1 and no
* vcards can be created (indicates error with certificates provided
* or db), or if any other higher level error (NSS error, missing coolkey). */
+static int vcard_emul_init_called = 0;
+
VCardEmulError
vcard_emul_init(const VCardEmulOptions *options)
{
@@ -736,6 +738,10 @@ vcard_emul_init(const VCardEmulOptions *options)
SECMODModuleList *mlp;
int i;
+ if (vcard_emul_init_called) {
+ return VCARD_EMUL_INIT_ALREADY_INITED;
+ }
+ vcard_emul_init_called = 1;
vreader_init();
vevent_queue_init();