Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(184)

Unified Diff: nss/mozilla/security/nss/lib/nss/nssinit.c

Issue 11193042: Update NSS to NSS 3.14 RC1. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/deps/third_party/
Patch Set: Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: nss/mozilla/security/nss/lib/nss/nssinit.c
===================================================================
--- nss/mozilla/security/nss/lib/nss/nssinit.c (revision 162724)
+++ nss/mozilla/security/nss/lib/nss/nssinit.c (working copy)
@@ -4,7 +4,7 @@
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-/* $Id: nssinit.c,v 1.118 2012/09/21 21:58:44 wtc%google.com Exp $ */
+/* $Id: nssinit.c,v 1.119 2012/10/09 18:22:46 emaldona%redhat.com Exp $ */
#include <ctype.h>
#include <string.h>
@@ -640,15 +640,19 @@
passwordRequired = pk11_password_required;
}
- /* we always try to initialize the modules */
- rv = nss_InitModules(configdir, certPrefix, keyPrefix, secmodName,
+ /* Skip the module init if we are already initted and we are trying
+ * to init with not noCertDB and noModDB */
wtc 2012/10/18 21:20:42 I believe "not" should be removed from this commen
Ryan Sleevi 2012/10/18 21:28:51 I think you're right
+ if (!(isReallyInitted && noCertDB && noModDB)) {
+ /* we always try to initialize the modules */
wtc 2012/10/18 21:20:42 This comment should be removed because nss_InitMod
Ryan Sleevi 2012/10/18 21:28:51 I agree
+ rv = nss_InitModules(configdir, certPrefix, keyPrefix, secmodName,
updateDir, updCertPrefix, updKeyPrefix, updateID,
updateName, configName, configStrings, passwordRequired,
readOnly, noCertDB, noModDB, forceOpen, optimizeSpace,
(initContextPtr != NULL));
- if (rv != SECSuccess) {
- goto loser;
+ if (rv != SECSuccess) {
+ goto loser;
+ }
}
@@ -923,6 +927,12 @@
{
int i;
+ /* make sure our lock and condition variable are initialized one and only
+ * one time */
+ if (PR_CallOnce(&nssInitOnce, nss_doLockInit) != PR_SUCCESS) {
+ return SECFailure;
+ }
+
PZ_Lock(nssInitLock);
if (!NSS_IsInitialized()) {
PZ_Unlock(nssInitLock);
@@ -981,6 +991,11 @@
{
int i;
+ /* make sure our lock and condition variable are initialized one and only
+ * one time */
+ if (PR_CallOnce(&nssInitOnce, nss_doLockInit) != PR_SUCCESS) {
+ return SECFailure;
+ }
PZ_Lock(nssInitLock);
if (!NSS_IsInitialized()) {
PZ_Unlock(nssInitLock);
@@ -1121,6 +1136,11 @@
NSS_Shutdown(void)
{
SECStatus rv;
+ /* make sure our lock and condition variable are initialized one and only
+ * one time */
+ if (PR_CallOnce(&nssInitOnce, nss_doLockInit) != PR_SUCCESS) {
+ return SECFailure;
+ }
PZ_Lock(nssInitLock);
if (!nssIsInitted) {
@@ -1173,6 +1193,11 @@
{
SECStatus rv = SECSuccess;
+ /* make sure our lock and condition variable are initialized one and only
+ * one time */
+ if (PR_CallOnce(&nssInitOnce, nss_doLockInit) != PR_SUCCESS) {
+ return SECFailure;
+ }
PZ_Lock(nssInitLock);
/* If one or more threads are in the middle of init, wait for them
* to complete */

Powered by Google App Engine
This is Rietveld 408576698