diff options
author | bsmith%mozilla.com <devnull@localhost> | 2012-12-03 20:18:29 +0000 |
---|---|---|
committer | bsmith%mozilla.com <devnull@localhost> | 2012-12-03 20:18:29 +0000 |
commit | de14c676a55b9ababe1e5ffa6865173a72c64c38 (patch) | |
tree | 7e3fdad329f30a93df059d14fd67062005eb6008 | |
parent | b3e10ee2f7eb85ff57b7e2682537b2d22fb151c6 (diff) | |
download | nss-hg-de14c676a55b9ababe1e5ffa6865173a72c64c38.tar.gz |
Backout patch for bug 578561 due to crash on Android (regression), a=bustageNSS_3_14_1_BETA2
-rw-r--r-- | security/nss/lib/softoken/sdb.c | 26 |
1 files changed, 1 insertions, 25 deletions
diff --git a/security/nss/lib/softoken/sdb.c b/security/nss/lib/softoken/sdb.c index 100f7d9ea..c6ff11037 100644 --- a/security/nss/lib/softoken/sdb.c +++ b/security/nss/lib/softoken/sdb.c @@ -1821,7 +1821,6 @@ sdb_init(char *dbname, char *table, sdbDataType type, int *inUpdate, enableCache = PR_TRUE; } else { char *tempDir = NULL; - PRBool mustFreeTempDir = PR_TRUE; PRUint32 tempOps = 0; /* * Use PR_Access to determine how expensive it @@ -1829,37 +1828,14 @@ sdb_init(char *dbname, char *table, sdbDataType type, int *inUpdate, * check in the temp directory. If the temp directory is faster, cache * the database there. */ tempDir = sdb_getTempDir(sqlDB); - - if (!tempDir) { - mustFreeTempDir = PR_FALSE; /* getenv will return references */ - tempDir = getenv("TEMP"); - if (!tempDir) - tempDir = getenv("TMP"); - if (!tempDir) { - tempDir = tempnam(NULL, NULL); - if (tempDir) { - char dirsep = PR_GetDirectorySeparator(); - char *end = PORT_Strrchr(tempDir, dirsep); - mustFreeTempDir = PR_TRUE; - if (end) { - /* We shorten the temp filename string to contain - * only the directory name. - */ - *end = 0; - } - } - } - } - if (tempDir) { tempOps = sdb_measureAccess(tempDir); + PORT_Free(tempDir); /* There is a cost to continually copying the database. * Account for that cost with the arbitrary factor of 10 */ enableCache = (PRBool)(tempOps > accessOps * 10); } - if (mustFreeTempDir) - PORT_Free(tempDir); } if (enableCache) { |