From dbf0743a51db9acd8919a0e2369a9c1258f59a0e Mon Sep 17 00:00:00 2001 From: Brian Smith Date: Mon, 12 Jan 2015 19:29:56 -0800 Subject: [PATCH] Bug 1120778: Update NSPR to NSPR 4.10.8 beta 3 (NSPR_4_10_8_BETA3), r=me --HG-- extra : rebase_source : 86352e7b5bcf8eaa7486a835f04676bbc8aed613 --- nsprpub/TAG-INFO | 2 +- nsprpub/config/prdepend.h | 1 + nsprpub/pr/src/io/prprf.c | 2 +- nsprpub/pr/src/md/windows/w95io.c | 5 +++-- nsprpub/pr/src/misc/prsystem.c | 13 +++++++++++-- nsprpub/pr/src/threads/combined/prucpu.c | 2 +- nsprpub/pr/src/threads/prdump.c | 2 +- 7 files changed, 19 insertions(+), 8 deletions(-) diff --git a/nsprpub/TAG-INFO b/nsprpub/TAG-INFO index d14a719ab1f..a5b9555a9bf 100644 --- a/nsprpub/TAG-INFO +++ b/nsprpub/TAG-INFO @@ -1 +1 @@ -NSPR_4_10_8_BETA2 +NSPR_4_10_8_BETA3 diff --git a/nsprpub/config/prdepend.h b/nsprpub/config/prdepend.h index e49e92677e3..6c66b37ca0f 100644 --- a/nsprpub/config/prdepend.h +++ b/nsprpub/config/prdepend.h @@ -10,3 +10,4 @@ */ #error "Do not include this header file." + diff --git a/nsprpub/pr/src/io/prprf.c b/nsprpub/pr/src/io/prprf.c index a2eb4171a84..ea6e4086fcd 100644 --- a/nsprpub/pr/src/io/prprf.c +++ b/nsprpub/pr/src/io/prprf.c @@ -18,7 +18,7 @@ #include "prlog.h" #include "prmem.h" -#ifdef _MSC_VER +#if defined(_MSC_VER) && _MSC_VER < 1900 #define snprintf _snprintf #endif diff --git a/nsprpub/pr/src/md/windows/w95io.c b/nsprpub/pr/src/md/windows/w95io.c index de55a8ffe1a..9bae6f8dfa9 100644 --- a/nsprpub/pr/src/md/windows/w95io.c +++ b/nsprpub/pr/src/md/windows/w95io.c @@ -955,9 +955,10 @@ _PR_MD_LOCKFILE(PROsfd f) 0l, 0l, 0x0l, 0xffffffffl ); if ( rv == 0 ) { - DWORD rc = GetLastError(); + DWORD err = GetLastError(); + _PR_MD_MAP_DEFAULT_ERROR(err); PR_LOG( _pr_io_lm, PR_LOG_ERROR, - ("_PR_MD_LOCKFILE() failed. Error: %d", rc )); + ("_PR_MD_LOCKFILE() failed. Error: %d", err )); rc = PR_FAILURE; } diff --git a/nsprpub/pr/src/misc/prsystem.c b/nsprpub/pr/src/misc/prsystem.c index 7a250713a68..eba85fb0b3f 100644 --- a/nsprpub/pr/src/misc/prsystem.c +++ b/nsprpub/pr/src/misc/prsystem.c @@ -24,7 +24,7 @@ /* BSD-derived systems use sysctl() to get the number of processors */ #if defined(BSDI) || defined(FREEBSD) || defined(NETBSD) \ - || defined(OPENBSD) || defined(DARWIN) + || defined(OPENBSD) || defined(DRAGONFLY) || defined(DARWIN) #define _PR_HAVE_SYSCTL #include #include @@ -275,15 +275,24 @@ PR_IMPLEMENT(PRUint64) PR_GetPhysicalMemorySize(void) if (pageSize >= 0 && pageCount >= 0) bytes = (PRUint64) pageSize * pageCount; -#elif defined(NETBSD) || defined(OPENBSD) +#elif defined(NETBSD) || defined(OPENBSD) \ + || defined(FREEBSD) || defined(DRAGONFLY) int mib[2]; int rc; +#ifdef HW_PHYSMEM64 uint64_t memSize; +#else + unsigned long memSize; +#endif size_t len = sizeof(memSize); mib[0] = CTL_HW; +#ifdef HW_PHYSMEM64 mib[1] = HW_PHYSMEM64; +#else + mib[1] = HW_PHYSMEM; +#endif rc = sysctl(mib, 2, &memSize, &len, NULL, 0); if (-1 != rc) { bytes = memSize; diff --git a/nsprpub/pr/src/threads/combined/prucpu.c b/nsprpub/pr/src/threads/combined/prucpu.c index 56322bb8eb6..3913dc8de67 100644 --- a/nsprpub/pr/src/threads/combined/prucpu.c +++ b/nsprpub/pr/src/threads/combined/prucpu.c @@ -124,7 +124,7 @@ static _PRCPUQueue *_PR_CreateCPUQueue(void) _MD_NEW_LOCK( &cpuQueue->sleepQLock ); _MD_NEW_LOCK( &cpuQueue->miscQLock ); - for (index = 0; index < PR_PRIORITY_LAST + 1; index++) + for (index = 0; index < PR_ARRAY_SIZE(cpuQueue->runQ); index++) PR_INIT_CLIST( &(cpuQueue->runQ[index]) ); PR_INIT_CLIST( &(cpuQueue->sleepQ) ); PR_INIT_CLIST( &(cpuQueue->pauseQ) ); diff --git a/nsprpub/pr/src/threads/prdump.c b/nsprpub/pr/src/threads/prdump.c index 7f3e591d3db..b40bee30cb3 100644 --- a/nsprpub/pr/src/threads/prdump.c +++ b/nsprpub/pr/src/threads/prdump.c @@ -87,7 +87,7 @@ void _PR_DumpThreads(PRFileDesc *fd) _PR_DumpThread(fd, t); _PR_DumpPrintf(fd, "Runnable Threads:\n"); - for (i = 0; i < 32; i++) { + for (i = 0; i < PR_ARRAY_SIZE(_PR_RUNQ(t->cpu)); i++) { DumpThreadQueue(fd, &_PR_RUNQ(t->cpu)[i]); }