Only touch _crypto_initialized if we actually change it

This commit is contained in:
Panu Matilainen 2009-01-08 13:03:55 +02:00
parent fa299eec0c
commit c895fb1541
1 changed files with 6 additions and 5 deletions

View File

@ -1496,12 +1496,13 @@ char * pgpArmorWrap(int atype, const unsigned char * s, size_t ns)
int rpmInitCrypto(void) {
int rc = 0;
if (!_crypto_initialized && NSS_NoDB_Init(NULL) != SECSuccess) {
rc = -1;
} else {
_crypto_initialized = 1;
if (!_crypto_initialized) {
if (NSS_NoDB_Init(NULL) != SECSuccess) {
rc = -1;
} else {
_crypto_initialized = 1;
}
}
return rc;
}