Skip to content

Commit

Permalink
Bug 1120778: Update NSPR to NSPR 4.10.8 beta 3 (NSPR_4_10_8_BETA3), r=me
Browse files Browse the repository at this point in the history
  • Loading branch information
briansmith committed Jan 13, 2015
1 parent 7cfab7f commit 8e432dd
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 8 deletions.
2 changes: 1 addition & 1 deletion nsprpub/TAG-INFO
Original file line number Diff line number Diff line change
@@ -1 +1 @@
NSPR_4_10_8_BETA2
NSPR_4_10_8_BETA3
1 change: 1 addition & 0 deletions nsprpub/config/prdepend.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@
*/

#error "Do not include this header file."

2 changes: 1 addition & 1 deletion nsprpub/pr/src/io/prprf.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#include "prlog.h"
#include "prmem.h"

#ifdef _MSC_VER
#if defined(_MSC_VER) && _MSC_VER < 1900
#define snprintf _snprintf
#endif

Expand Down
5 changes: 3 additions & 2 deletions nsprpub/pr/src/md/windows/w95io.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
13 changes: 11 additions & 2 deletions nsprpub/pr/src/misc/prsystem.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 <sys/param.h>
#include <sys/sysctl.h>
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion nsprpub/pr/src/threads/combined/prucpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) );
Expand Down
2 changes: 1 addition & 1 deletion nsprpub/pr/src/threads/prdump.c
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
}

Expand Down

0 comments on commit 8e432dd

Please sign in to comment.