Bug 1162780 - Update NSPR to NSPR_4_10_9_BETA2. r=ted
authorJed Davis <jld@mozilla.com>
Wed, 22 Jul 2015 10:52:39 -0700
changeset 254300 e65ce3ee7cde2a0b1e1c96b1317a1a8e6447dfae
parent 254299 4625fdae1cc334a1307a15542cad34e9c775df7d
child 254301 26ecefcc6db8a86a6d5e33513d474c666e7dbde4
push id16678
push userryanvm@gmail.com
push dateThu, 23 Jul 2015 20:05:01 +0000
treeherderb2g-inbound@cb8bdb8ffaef [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersted
bugs1162780
milestone42.0a1
Bug 1162780 - Update NSPR to NSPR_4_10_9_BETA2. r=ted
nsprpub/TAG-INFO
nsprpub/config/prdepend.h
nsprpub/configure
nsprpub/configure.in
nsprpub/pr/include/md/_linux.cfg
nsprpub/pr/include/prenv.h
nsprpub/pr/include/prinit.h
nsprpub/pr/include/prlog.h
nsprpub/pr/include/prtime.h
nsprpub/pr/include/prtypes.h
nsprpub/pr/src/io/prfdcach.c
nsprpub/pr/src/io/prmwait.c
nsprpub/pr/src/io/prprf.c
nsprpub/pr/src/misc/prenv.c
nsprpub/pr/src/misc/prtime.c
nsprpub/pr/src/pthreads/ptsynch.c
nsprpub/pr/src/pthreads/ptthread.c
nsprpub/pr/tests/Makefile.in
nsprpub/pr/tests/README.TXT
nsprpub/pr/tests/env.c
nsprpub/pr/tests/prfz.c
nsprpub/pr/tests/runtests.pl
nsprpub/pr/tests/runtests.sh
nsprpub/pr/tests/vercheck.c
--- a/nsprpub/TAG-INFO
+++ b/nsprpub/TAG-INFO
@@ -1,1 +1,1 @@
-NSPR_4_10_8_RTM
+NSPR_4_10_9_BETA2
--- a/nsprpub/config/prdepend.h
+++ b/nsprpub/config/prdepend.h
@@ -5,8 +5,9 @@
 
 /*
  * A dummy header file that is a dependency for all the object files.
  * Used to force a full recompilation of NSPR in Mozilla's Tinderbox
  * depend builds.  See comments in rules.mk.
  */
 
 #error "Do not include this header file."
+
--- a/nsprpub/configure
+++ b/nsprpub/configure
@@ -2484,17 +2484,17 @@ case $target_os in *\ *) target_os=`echo
 # will get canonicalized.
 test -n "$target_alias" &&
   test "$program_prefix$program_suffix$program_transform_name" = \
     NONENONEs,x,x, &&
   program_prefix=${target_alias}-
 
 MOD_MAJOR_VERSION=4
 MOD_MINOR_VERSION=10
-MOD_PATCH_VERSION=8
+MOD_PATCH_VERSION=9
 NSPR_MODNAME=nspr20
 _HAVE_PTHREADS=
 USE_PTHREADS=
 USE_USER_PTHREADS=
 USE_NSPR_THREADS=
 USE_N32=
 USE_X32=
 USE_64=
@@ -2661,16 +2661,29 @@ esac
 # Check whether --with-gonk was given.
 if test "${with_gonk+set}" = set; then :
   withval=$with_gonk; gonkdir=$withval
 fi
 
 
 if test -n "$gonkdir" ; then
 
+        if test -z "$HOST_CPPFLAGS" ; then
+        HOST_CPPFLAGS=" "
+    fi
+    if test -z "$HOST_CFLAGS" ; then
+        HOST_CFLAGS=" "
+    fi
+    if test -z "$HOST_CXXFLAGS" ; then
+        HOST_CXXFLAGS=" "
+    fi
+    if test -z "$HOST_LDFLAGS" ; then
+        HOST_LDFLAGS=" "
+    fi
+
     $as_echo "#define ANDROID 1" >>confdefs.h
 
 else
 case "$target" in
 *-android*|*-linuxandroid*)
     if test -z "$android_ndk" ; then
        as_fn_error $? "You must specify --with-android-ndk=/path/to/ndk when targeting Android." "$LINENO" 5
     fi
@@ -2745,16 +2758,29 @@ case "$target" in
     RANLIB="$android_toolchain"/bin/"$android_tool_prefix"-ranlib
     STRIP="$android_toolchain"/bin/"$android_tool_prefix"-strip
 
     CPPFLAGS="-I$android_platform/usr/include $CPPFLAGS"
     CFLAGS="-mandroid -I$android_platform/usr/include -fno-short-enums -fno-exceptions $CFLAGS"
     CXXFLAGS="-mandroid -I$android_platform/usr/include -fpic -fno-short-enums -fno-exceptions $CXXFLAGS"
     LDFLAGS="-mandroid -L$android_platform/usr/lib -Wl,-rpath-link=$android_platform/usr/lib --sysroot=$android_platform $LDFLAGS"
 
+        if test -z "$HOST_CPPFLAGS" ; then
+        HOST_CPPFLAGS=" "
+    fi
+    if test -z "$HOST_CFLAGS" ; then
+        HOST_CFLAGS=" "
+    fi
+    if test -z "$HOST_CXXFLAGS" ; then
+        HOST_CXXFLAGS=" "
+    fi
+    if test -z "$HOST_LDFLAGS" ; then
+        HOST_LDFLAGS=" "
+    fi
+
     $as_echo "#define ANDROID 1" >>confdefs.h
 
     ;;
 esac
 fi
 
 dist_prefix='${MOD_DEPTH}/dist'
 dist_bindir='${dist_prefix}/bin'
@@ -4590,16 +4616,22 @@ fi
 done
 test -n "$HOST_CC" || HOST_CC=""""
 
     if test -z "$HOST_CC"; then
         as_fn_error $? "no acceptable cc found in \$PATH" "$LINENO" 5
     fi
     { $as_echo "$as_me:${as_lineno-$LINENO}: result: $HOST_CC" >&5
 $as_echo "$HOST_CC" >&6; }
+    if test -z "$HOST_CFLAGS"; then
+        HOST_CFLAGS="$CFLAGS"
+    fi
+    if test -z "$HOST_LDFLAGS"; then
+        HOST_LDFLAGS="$LDFLAGS"
+    fi
 
     CC="$HOST_CC"
     CFLAGS="$HOST_CFLAGS"
     LDFLAGS="$HOST_LDFLAGS"
 
     { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host compiler ($HOST_CC $HOST_CFLAGS $HOST_LDFLAGS) works" >&5
 $as_echo_n "checking whether the $host compiler ($HOST_CC $HOST_CFLAGS $HOST_LDFLAGS) works... " >&6; }
 
@@ -6547,16 +6579,17 @@ fi
             CPU_ARCH=ppc
             ;;
     esac
     if test "`echo $CC | grep -c '\-arch '`" = "0"; then
         CC="$CC -arch $CPU_ARCH"
     fi
     ac_fn_c_check_header_mongrel "$LINENO" "crt_externs.h" "ac_cv_header_crt_externs_h" "$ac_includes_default"
 if test "x$ac_cv_header_crt_externs_h" = xyes; then :
+  $as_echo "#define HAVE_CRT_EXTERNS_H 1" >>confdefs.h
 
 fi
 
 
     DSO_CFLAGS=-fPIC
     DSO_LDOPTS='-dynamiclib -compatibility_version 1 -current_version 1 -all_load -install_name @executable_path/$@ -headerpad_max_install_names'
     _OPTIMIZE_FLAGS=-O2
     MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
@@ -7279,16 +7312,18 @@ tools are selected during the Xcode/Deve
 
 *-netbsd*)
     $as_echo "#define XP_UNIX 1" >>confdefs.h
 
     $as_echo "#define NETBSD 1" >>confdefs.h
 
     $as_echo "#define HAVE_BSD_FLOCK 1" >>confdefs.h
 
+    $as_echo "#define HAVE_SOCKLEN_T 1" >>confdefs.h
+
     if test -z "$USE_NSPR_THREADS"; then
         USE_PTHREADS=1
     fi
     MDCPUCFG_H=_netbsd.cfg
     PR_MD_CSRCS=netbsd.c
 
     DSO_CFLAGS='-fPIC -DPIC'
     CFLAGS="$CFLAGS -ansi -Wall"
--- a/nsprpub/configure.in
+++ b/nsprpub/configure.in
@@ -11,17 +11,17 @@ AC_CONFIG_SRCDIR([pr/include/nspr.h])
 AC_CONFIG_AUX_DIR(${srcdir}/build/autoconf)
 AC_CANONICAL_TARGET
 
 dnl ========================================================
 dnl = Defaults
 dnl ========================================================
 MOD_MAJOR_VERSION=4
 MOD_MINOR_VERSION=10
-MOD_PATCH_VERSION=8
+MOD_PATCH_VERSION=9
 NSPR_MODNAME=nspr20
 _HAVE_PTHREADS=
 USE_PTHREADS=
 USE_USER_PTHREADS=
 USE_NSPR_THREADS=
 USE_N32=
 USE_X32=
 USE_64=
@@ -155,16 +155,30 @@ dnl ====================================
 
 AC_ARG_WITH(gonk,
 [  --with-gonk=DIR         location of gonk dir],
     gonkdir=$withval)
 
 if test -n "$gonkdir" ; then
     dnl Most things are directly configured by env vars when building for gonk
 
+    dnl prevent cross compile section from using these flags as host flags
+    if test -z "$HOST_CPPFLAGS" ; then
+        HOST_CPPFLAGS=" "
+    fi
+    if test -z "$HOST_CFLAGS" ; then
+        HOST_CFLAGS=" "
+    fi
+    if test -z "$HOST_CXXFLAGS" ; then
+        HOST_CXXFLAGS=" "
+    fi
+    if test -z "$HOST_LDFLAGS" ; then
+        HOST_LDFLAGS=" "
+    fi
+
     AC_DEFINE(ANDROID)
 else
 case "$target" in
 *-android*|*-linuxandroid*)
     if test -z "$android_ndk" ; then
        AC_MSG_ERROR([You must specify --with-android-ndk=/path/to/ndk when targeting Android.])
     fi
 
@@ -238,16 +252,30 @@ case "$target" in
     RANLIB="$android_toolchain"/bin/"$android_tool_prefix"-ranlib
     STRIP="$android_toolchain"/bin/"$android_tool_prefix"-strip
 
     CPPFLAGS="-I$android_platform/usr/include $CPPFLAGS"
     CFLAGS="-mandroid -I$android_platform/usr/include -fno-short-enums -fno-exceptions $CFLAGS"
     CXXFLAGS="-mandroid -I$android_platform/usr/include -fpic -fno-short-enums -fno-exceptions $CXXFLAGS"
     LDFLAGS="-mandroid -L$android_platform/usr/lib -Wl,-rpath-link=$android_platform/usr/lib --sysroot=$android_platform $LDFLAGS"
 
+    dnl prevent cross compile section from using these flags as host flags
+    if test -z "$HOST_CPPFLAGS" ; then
+        HOST_CPPFLAGS=" "
+    fi
+    if test -z "$HOST_CFLAGS" ; then
+        HOST_CFLAGS=" "
+    fi
+    if test -z "$HOST_CXXFLAGS" ; then
+        HOST_CXXFLAGS=" "
+    fi
+    if test -z "$HOST_LDFLAGS" ; then
+        HOST_LDFLAGS=" "
+    fi
+
     AC_DEFINE(ANDROID)
     ;;
 esac
 fi
 
 dnl ========================================================
 dnl =
 dnl = Check options that may affect the compiler
@@ -620,16 +648,22 @@ if test "$target" != "$host"; then
     _SAVE_LDFLAGS="$LDFLAGS"
 
     AC_MSG_CHECKING([for $host compiler])
     AC_CHECK_PROGS(HOST_CC, $HOST_CC gcc cc /usr/ucb/cc, "")
     if test -z "$HOST_CC"; then
         AC_MSG_ERROR([no acceptable cc found in \$PATH])
     fi
     AC_MSG_RESULT([$HOST_CC])
+    if test -z "$HOST_CFLAGS"; then
+        HOST_CFLAGS="$CFLAGS"
+    fi
+    if test -z "$HOST_LDFLAGS"; then
+        HOST_LDFLAGS="$LDFLAGS"
+    fi
 
     CC="$HOST_CC"
     CFLAGS="$HOST_CFLAGS"
     LDFLAGS="$HOST_LDFLAGS"
 
     AC_MSG_CHECKING([whether the $host compiler ($HOST_CC $HOST_CFLAGS $HOST_LDFLAGS) works])
     AC_TRY_COMPILE([], [return 0;],
         [AC_MSG_RESULT([yes])],
@@ -1373,17 +1407,17 @@ case "$target" in
             ;;
         *)
             CPU_ARCH=ppc
             ;;
     esac
     if test "`echo $CC | grep -c '\-arch '`" = "0"; then
         CC="$CC -arch $CPU_ARCH"
     fi
-    AC_CHECK_HEADER(crt_externs.h)
+    AC_CHECK_HEADER(crt_externs.h, AC_DEFINE(HAVE_CRT_EXTERNS_H))
     DSO_CFLAGS=-fPIC
     DSO_LDOPTS='-dynamiclib -compatibility_version 1 -current_version 1 -all_load -install_name @executable_path/$@ -headerpad_max_install_names'
     _OPTIMIZE_FLAGS=-O2
     MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
     STRIP="$STRIP -x -S"
     DLL_SUFFIX=dylib
     USE_PTHREADS=1
     MDCPUCFG_H=_darwin.cfg
@@ -2081,16 +2115,17 @@ tools are selected during the Xcode/Deve
 	    ;;
     esac
     ;;
 
 *-netbsd*)
     AC_DEFINE(XP_UNIX)
     AC_DEFINE(NETBSD)
     AC_DEFINE(HAVE_BSD_FLOCK)
+    AC_DEFINE(HAVE_SOCKLEN_T)
     if test -z "$USE_NSPR_THREADS"; then
         USE_PTHREADS=1
     fi
     MDCPUCFG_H=_netbsd.cfg
     PR_MD_CSRCS=netbsd.c
 
     DSO_CFLAGS='-fPIC -DPIC'
     CFLAGS="$CFLAGS -ansi -Wall"
--- a/nsprpub/pr/include/md/_linux.cfg
+++ b/nsprpub/pr/include/md/_linux.cfg
@@ -503,16 +503,62 @@
 #undef  IS_LITTLE_ENDIAN
 #elif defined(__MIPSEL__)
 #define IS_LITTLE_ENDIAN 1
 #undef  IS_BIG_ENDIAN
 #else
 #error "Unknown MIPS endianness."
 #endif
 
+#ifdef _ABI64
+
+#define IS_64
+
+#define PR_BYTES_PER_BYTE   1
+#define PR_BYTES_PER_SHORT  2
+#define PR_BYTES_PER_INT    4
+#define PR_BYTES_PER_INT64  8
+#define PR_BYTES_PER_LONG   8
+#define PR_BYTES_PER_FLOAT  4
+#define PR_BYTES_PER_DOUBLE 8
+#define PR_BYTES_PER_WORD   8
+#define PR_BYTES_PER_DWORD  8
+
+#define PR_BITS_PER_BYTE    8
+#define PR_BITS_PER_SHORT   16
+#define PR_BITS_PER_INT     32
+#define PR_BITS_PER_INT64   64
+#define PR_BITS_PER_LONG    64
+#define PR_BITS_PER_FLOAT   32
+#define PR_BITS_PER_DOUBLE  64
+#define PR_BITS_PER_WORD    64
+
+#define PR_BITS_PER_BYTE_LOG2   3
+#define PR_BITS_PER_SHORT_LOG2  4
+#define PR_BITS_PER_INT_LOG2    5
+#define PR_BITS_PER_INT64_LOG2  6
+#define PR_BITS_PER_LONG_LOG2   6
+#define PR_BITS_PER_FLOAT_LOG2  5
+#define PR_BITS_PER_DOUBLE_LOG2 6
+#define PR_BITS_PER_WORD_LOG2   6
+
+#define PR_ALIGN_OF_SHORT   2
+#define PR_ALIGN_OF_INT     4
+#define PR_ALIGN_OF_LONG    8
+#define PR_ALIGN_OF_INT64   8
+#define PR_ALIGN_OF_FLOAT   4
+#define PR_ALIGN_OF_DOUBLE  8
+#define PR_ALIGN_OF_POINTER 8
+#define PR_ALIGN_OF_WORD    8
+
+#define PR_BYTES_PER_WORD_LOG2   3
+#define PR_BYTES_PER_DWORD_LOG2  3
+
+#else /* _ABI64 */
+
 #define PR_BYTES_PER_BYTE   1
 #define PR_BYTES_PER_SHORT  2
 #define PR_BYTES_PER_INT    4
 #define PR_BYTES_PER_INT64  8
 #define PR_BYTES_PER_LONG   4
 #define PR_BYTES_PER_FLOAT  4
 #define PR_BYTES_PER_DOUBLE 8
 #define PR_BYTES_PER_WORD   4
@@ -543,16 +589,18 @@
 #define PR_ALIGN_OF_FLOAT   4
 #define PR_ALIGN_OF_DOUBLE  8
 #define PR_ALIGN_OF_POINTER 4
 #define PR_ALIGN_OF_WORD    4
 
 #define PR_BYTES_PER_WORD_LOG2   2
 #define PR_BYTES_PER_DWORD_LOG2  3
 
+#endif /* _ABI64 */
+
 #elif defined(__arm__)
 
 #ifdef __ARMEB__
 #undef  IS_LITTLE_ENDIAN
 #define IS_BIG_ENDIAN 1
 #elif defined(__ARMEL__)
 #define IS_LITTLE_ENDIAN 1
 #undef  IS_BIG_ENDIAN
--- a/nsprpub/pr/include/prenv.h
+++ b/nsprpub/pr/include/prenv.h
@@ -108,11 +108,41 @@ NSPR_API(char*) PR_GetEnv(const char *va
 ** Restrictions: 
 **   See the Restrictions documented in the description of
 **   PR_GetEnv() in this header file.
 ** 
 ** 
 */
 NSPR_API(PRStatus) PR_SetEnv(const char *string);
 
+/*
+** PR_DuplicateEnvironment() -- Obtain a copy of the environment.
+**
+** Description:
+** PR_DuplicateEnvironment() copies the environment so that it can be
+** modified without changing the current process's environment, and
+** then passed to interfaces such as POSIX execve().  In particular,
+** this avoids needing to allocate memory or take locks in the child
+** after a fork(); neither of these is allowed by POSIX after a
+** multithreaded process calls fork(), and PR_SetEnv does both.
+**
+** Inputs:
+**   none
+**
+** Returns:
+**   A pointer to a null-terminated array of null-terminated strings,
+**   like the traditional global variable "environ".  The array and
+**   the strings are allocated with PR_Malloc(), and it is the
+**   caller's responsibility to free them.
+**
+**   In case of memory allocation failure, or if the operating system
+**   doesn't support reading the entire environment through the global
+**   variable "environ" or similar, returns NULL instead.
+**
+** Restrictions:
+**   Similarly to PR_GetEnv(), this function may not interoperate as
+**   expected with the operating system's native environment accessors.
+*/
+NSPR_API(char **) PR_DuplicateEnvironment(void);
+
 PR_END_EXTERN_C
 
 #endif /* prenv_h___ */
--- a/nsprpub/pr/include/prinit.h
+++ b/nsprpub/pr/include/prinit.h
@@ -26,21 +26,21 @@ PR_BEGIN_EXTERN_C
 /*
 ** NSPR's version is used to determine the likelihood that the version you
 ** used to build your component is anywhere close to being compatible with
 ** what is in the underlying library.
 **
 ** The format of the version string is
 **     "<major version>.<minor version>[.<patch level>] [<Beta>]"
 */
-#define PR_VERSION  "4.10.8"
+#define PR_VERSION  "4.10.9 Beta"
 #define PR_VMAJOR   4
 #define PR_VMINOR   10
-#define PR_VPATCH   8
-#define PR_BETA     PR_FALSE
+#define PR_VPATCH   9
+#define PR_BETA     PR_TRUE
 
 /*
 ** PRVersionCheck
 **
 ** The basic signature of the function that is called to provide version
 ** checking. The result will be a boolean that indicates the likelihood
 ** that the underling library will perform as the caller expects.
 **
--- a/nsprpub/pr/include/prlog.h
+++ b/nsprpub/pr/include/prlog.h
@@ -152,17 +152,18 @@ NSPR_API(void) PR_SetLogBuffering(PRIntn
 */
 NSPR_API(void) PR_LogPrint(const char *fmt, ...);
 
 /*
 ** Flush the log to its file.
 */
 NSPR_API(void) PR_LogFlush(void);
 
-NSPR_API(void) PR_Assert(const char *s, const char *file, PRIntn ln);
+NSPR_API(void) PR_Assert(const char *s, const char *file, PRIntn ln)
+    PR_PRETEND_NORETURN;
 
 #if defined(DEBUG) || defined(FORCE_PR_LOG)
 #define PR_LOGGING 1
 
 #define PR_LOG_TEST(_module,_level) \
     ((_module)->level >= (_level))
 
 /*
--- a/nsprpub/pr/include/prtime.h
+++ b/nsprpub/pr/include/prtime.h
@@ -243,20 +243,20 @@ NSPR_API(PRStatus) PR_ParseTimeStringToE
 
 NSPR_API(PRStatus) PR_ParseTimeString (
 	const char *string,
 	PRBool default_to_gmt,
 	PRTime *result);
 
 /* Format a time value into a buffer. Same semantics as strftime() */
 NSPR_API(PRUint32) PR_FormatTime(char *buf, int buflen, const char *fmt,
-                                           const PRExplodedTime *tm);
+                                 const PRExplodedTime *time);
 
-/* Format a time value into a buffer. Time is always in US English format, regardless
- * of locale setting.
+/* Format a time value into a buffer. Time is always in US English format,
+ * regardless of locale setting.
  */
 NSPR_API(PRUint32)
-PR_FormatTimeUSEnglish( char* buf, PRUint32 bufSize,
-                        const char* format, const PRExplodedTime* tm );
+PR_FormatTimeUSEnglish(char *buf, PRUint32 bufSize,
+                       const char *format, const PRExplodedTime *time);
 
 PR_END_EXTERN_C
 
 #endif /* prtime_h___ */
--- a/nsprpub/pr/include/prtypes.h
+++ b/nsprpub/pr/include/prtypes.h
@@ -505,16 +505,41 @@ typedef PRUint16 PRUnichar;
 #ifdef _WIN64
 typedef PRInt64 PRWord;
 typedef PRUint64 PRUword;
 #else
 typedef long PRWord;
 typedef unsigned long PRUword;
 #endif
 
+/*
+ * PR_PRETEND_NORETURN, specified at the end of a function declaration,
+ * indicates that for the purposes of static analysis, this function does not
+ * return.  (The function definition does not need to be annotated.)
+ *
+ * void PR_Assert(const char *s, const char *file, PRIntn ln)
+ *     PR_PRETEND_NORETURN;
+ *
+ * Some static analyzers, like scan-build from clang, can use this information
+ * to eliminate false positives.  From the upstream documentation of
+ * scan-build:
+ *     This attribute is useful for annotating assertion handlers that actually
+ *     can return, but for the purpose of using the analyzer we want to pretend
+ *     that such functions do not return.
+ */
+#ifdef __clang_analyzer__
+#if __has_extension(attribute_analyzer_noreturn)
+#define PR_PRETEND_NORETURN __attribute__((analyzer_noreturn))
+#endif
+#endif
+
+#ifndef PR_PRETEND_NORETURN
+#define PR_PRETEND_NORETURN /* no support */
+#endif
+
 #if defined(NO_NSPR_10_SUPPORT)
 #else
 /********* ???????????????? FIX ME       ??????????????????????????? *****/
 /********************** Some old definitions until pr=>ds transition is done ***/
 /********************** Also, we are still using NSPR 1.0. GC ******************/
 /*
 ** Fundamental NSPR macros, used nearly everywhere.
 */
--- a/nsprpub/pr/src/io/prfdcach.c
+++ b/nsprpub/pr/src/io/prfdcach.c
@@ -208,17 +208,16 @@ void _PR_InitFdCache(void)
     _pr_fd_cache.ml = PR_NewLock();
     PR_ASSERT(NULL != _pr_fd_cache.ml);
 
 }  /* _PR_InitFdCache */
 
 void _PR_CleanupFdCache(void)
 {
     PRFileDesc *fd, *next;
-    PRStackElem *pop;
 
     for (fd = _pr_fd_cache.head; fd != NULL; fd = next)
     {
         next = fd->higher;
         PR_DELETE(fd->secret);
         PR_DELETE(fd);
     }
     _pr_fd_cache.head = NULL;
--- a/nsprpub/pr/src/io/prmwait.c
+++ b/nsprpub/pr/src/io/prmwait.c
@@ -470,16 +470,17 @@ static PRStatus _MW_PollInternal(PRWaitG
                 PR_Lock(group->ml);
                 goto failed_alloc;
             }
             if (NULL != old_polling_list)
                 PR_DELETE(old_polling_list);
             PR_Lock(group->ml);
             if (_prmw_running != group->state)
             {
+                PR_DELETE(poll_list);
                 PR_SetError(PR_INVALID_STATE_ERROR, 0);
                 goto aborted;
             }
             group->polling_list = poll_list;
             group->polling_count = new_count;
         }
 
         now = PR_IntervalNow();
--- a/nsprpub/pr/src/io/prprf.c
+++ b/nsprpub/pr/src/io/prprf.c
@@ -61,17 +61,21 @@ struct NumArg {
 #ifdef WIN32
 	const WCHAR *ws;
 #endif
     } u;
 };
 
 #define NAS_DEFAULT_NUM 20  /* default number of NumberedArgument array */
 
-
+/*
+** For numeric types, the signed versions must have even values,
+** and their corresponding unsigned versions must have the subsequent
+** odd value.
+*/
 #define TYPE_INT16	0
 #define TYPE_UINT16	1
 #define TYPE_INTN	2
 #define TYPE_UINTN	3
 #define TYPE_INT32	4
 #define TYPE_UINT32	5
 #define TYPE_INT64	6
 #define TYPE_UINT64	7
@@ -371,18 +375,18 @@ static int cvt_s(SprintfState *ss, const
     }
 
     /* and away we go */
     return fill2(ss, str, slen, width, flags);
 }
 
 /*
 ** BuildArgArray stands for Numbered Argument list Sprintf
-** for example,  
-**	fmp = "%4$i, %2$d, %3s, %1d";
+** for example,
+**	fmt = "%4$i, %2$d, %3s, %1d";
 ** the number must start from 1, and no gap among them
 */
 
 static struct NumArg* BuildArgArray( const char *fmt, va_list ap, int* rv, struct NumArg* nasArray )
 {
     int number = 0, cn = 0, i;
     const char* p;
     char  c;
@@ -510,16 +514,25 @@ static struct NumArg* BuildArgArray( con
 	    c = *p++;
 	} else if (c == 'l') {
 	    nas[cn].type = TYPE_INT32;
 	    c = *p++;
 	    if (c == 'l') {
 	        nas[cn].type = TYPE_INT64;
 	        c = *p++;
 	    }
+	} else if (c == 'z') {
+	    if (sizeof(size_t) == sizeof(PRInt32)) {
+	        nas[ cn ].type = TYPE_INT32;
+	    } else if (sizeof(size_t) == sizeof(PRInt64)) {
+	        nas[ cn ].type = TYPE_INT64;
+	    } else {
+		nas[ cn ].type = TYPE_UNKNOWN;
+	    }
+	    c = *p++;
 	}
 
 	/* format */
 	switch (c) {
 	case 'd':
 	case 'c':
 	case 'i':
 	case 'o':
@@ -804,16 +817,23 @@ static int dosprintf(SprintfState *ss, c
 	    c = *fmt++;
 	} else if (c == 'l') {
 	    type = TYPE_INT32;
 	    c = *fmt++;
 	    if (c == 'l') {
 		type = TYPE_INT64;
 		c = *fmt++;
 	    }
+	} else if (c == 'z') {
+	    if (sizeof(size_t) == sizeof(PRInt32)) {
+	    	type = TYPE_INT32;
+	    } else if (sizeof(size_t) == sizeof(PRInt64)) {
+	    	type = TYPE_INT64;
+	    }
+	    c = *fmt++;
 	}
 
 	/* format */
 	hexp = hex;
 	switch (c) {
 	  case 'd': case 'i':			/* decimal/integer */
 	    radix = 10;
 	    goto fetch_and_convert;
--- a/nsprpub/pr/src/misc/prenv.c
+++ b/nsprpub/pr/src/misc/prenv.c
@@ -1,15 +1,26 @@
 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* 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/. */
 
 #include <string.h>
 #include "primpl.h"
+#include "prmem.h"
+
+#if defined(XP_UNIX)
+#if defined(DARWIN)
+#if defined(HAVE_CRT_EXTERNS_H)
+#include <crt_externs.h>
+#endif /* HAVE_CRT_EXTERNS_H */
+#else  /* DARWIN */
+PR_IMPORT_DATA(char **) environ;
+#endif /* DARWIN */
+#endif /* XP_UNIX */
 
 /* Lock used to lock the environment */
 #if defined(_PR_NO_PREEMPT)
 #define _PR_NEW_LOCK_ENV()
 #define _PR_DELETE_LOCK_ENV()
 #define _PR_LOCK_ENV()
 #define _PR_UNLOCK_ENV()
 #elif defined(_PR_LOCAL_THREADS_ONLY)
@@ -53,15 +64,64 @@ PR_IMPLEMENT(char*) PR_GetEnv(const char
 }
 
 PR_IMPLEMENT(PRStatus) PR_SetEnv(const char *string)
 {
     PRIntn result;
 
     if (!_pr_initialized) _PR_ImplicitInitialization();
 
-    if ( !strchr(string, '=')) return(PR_FAILURE);
+    if (!strchr(string, '=')) return(PR_FAILURE);
+
+    _PR_LOCK_ENV();
+    result = _PR_MD_PUT_ENV((char*)string);
+    _PR_UNLOCK_ENV();
+    return result ? PR_FAILURE : PR_SUCCESS;
+}
+
+#if defined(XP_UNIX) && (!defined(DARWIN) || defined(HAVE_CRT_EXTERNS_H))
+PR_IMPLEMENT(char **) PR_DuplicateEnvironment(void)
+{
+    char **the_environ, **result, **end, **src, **dst;
 
     _PR_LOCK_ENV();
-    result = _PR_MD_PUT_ENV(string);
+#ifdef DARWIN
+    the_environ = *(_NSGetEnviron());
+#else
+    the_environ = environ;
+#endif
+
+    for (end = the_environ; *end != NULL; end++)
+        /* empty loop body */;
+
+    result = (char **)PR_Malloc(sizeof(char *) * (end - the_environ + 1));
+    if (result != NULL) {
+        for (src = the_environ, dst = result; src != end; src++, dst++) {
+            size_t len;
+
+            len = strlen(*src) + 1;
+            *dst = PR_Malloc(len);
+            if (*dst == NULL) {
+              /* Allocation failed.  Must clean up the half-copied env. */
+              char **to_delete;
+
+              for (to_delete = result; to_delete != dst; to_delete++) {
+                PR_Free(*to_delete);
+              }
+              PR_Free(result);
+              result = NULL;
+              goto out;
+            }
+            memcpy(*dst, *src, len);
+        }
+        *dst = NULL;
+    }
+ out:
     _PR_UNLOCK_ENV();
-    return (result)? PR_FAILURE : PR_SUCCESS;
+    return result;
 }
+#else
+/* This platform doesn't support raw access to the environ block. */
+PR_IMPLEMENT(char **) PR_DuplicateEnvironment(void)
+{
+    return NULL;
+}
+#endif
--- a/nsprpub/pr/src/misc/prtime.c
+++ b/nsprpub/pr/src/misc/prtime.c
@@ -1667,45 +1667,46 @@ PR_ParseTimeString(
  * PR_FormatTime --
  *
  *     Format a time value into a buffer. Same semantics as strftime().
  *
  *-----------------------------------------------------------------------
  */
 
 PR_IMPLEMENT(PRUint32)
-PR_FormatTime(char *buf, int buflen, const char *fmt, const PRExplodedTime *tm)
+PR_FormatTime(char *buf, int buflen, const char *fmt,
+              const PRExplodedTime *time)
 {
     size_t rv;
     struct tm a;
     struct tm *ap;
 
-    if (tm) {
+    if (time) {
         ap = &a;
-        a.tm_sec = tm->tm_sec;
-        a.tm_min = tm->tm_min;
-        a.tm_hour = tm->tm_hour;
-        a.tm_mday = tm->tm_mday;
-        a.tm_mon = tm->tm_month;
-        a.tm_wday = tm->tm_wday;
-        a.tm_year = tm->tm_year - 1900;
-        a.tm_yday = tm->tm_yday;
-        a.tm_isdst = tm->tm_params.tp_dst_offset ? 1 : 0;
+        a.tm_sec = time->tm_sec;
+        a.tm_min = time->tm_min;
+        a.tm_hour = time->tm_hour;
+        a.tm_mday = time->tm_mday;
+        a.tm_mon = time->tm_month;
+        a.tm_wday = time->tm_wday;
+        a.tm_year = time->tm_year - 1900;
+        a.tm_yday = time->tm_yday;
+        a.tm_isdst = time->tm_params.tp_dst_offset ? 1 : 0;
 
         /*
          * On some platforms, for example SunOS 4, struct tm has two
          * additional fields: tm_zone and tm_gmtoff.
          */
 
 #if (__GLIBC__ >= 2) || defined(XP_BEOS) \
         || defined(NETBSD) || defined(OPENBSD) || defined(FREEBSD) \
         || defined(DARWIN) || defined(SYMBIAN) || defined(ANDROID)
         a.tm_zone = NULL;
-        a.tm_gmtoff = tm->tm_params.tp_gmt_offset +
-                      tm->tm_params.tp_dst_offset;
+        a.tm_gmtoff = time->tm_params.tp_gmt_offset +
+                      time->tm_params.tp_dst_offset;
 #endif
     } else {
         ap = NULL;
     }
 
     rv = strftime(buf, buflen, fmt, ap);
     if (!rv && buf && buflen > 0) {
         /*
--- a/nsprpub/pr/src/pthreads/ptsynch.c
+++ b/nsprpub/pr/src/pthreads/ptsynch.c
@@ -317,35 +317,46 @@ static void pt_PostNotifyToCvar(PRCondVa
 }  /* pt_PostNotifyToCvar */
 
 PR_IMPLEMENT(PRCondVar*) PR_NewCondVar(PRLock *lock)
 {
     PRCondVar *cv = PR_NEW(PRCondVar);
     PR_ASSERT(lock != NULL);
     if (cv != NULL)
     {
-        int rv = _PT_PTHREAD_COND_INIT(cv->cv, _pt_cvar_attr); 
+        int rv = _PT_PTHREAD_COND_INIT(cv->cv, _pt_cvar_attr);
         PR_ASSERT(0 == rv);
-        cv->lock = lock;
-        cv->notify_pending = 0;
+        if (0 == rv)
+        {
+            cv->lock = lock;
+            cv->notify_pending = 0;
 #if defined(DEBUG)
-        pt_debug.cvars_created += 1;
+            pt_debug.cvars_created += 1;
 #endif
+        }
+        else
+        {
+            PR_DELETE(cv);
+            cv = NULL;
+        }
     }
     return cv;
 }  /* PR_NewCondVar */
 
 PR_IMPLEMENT(void) PR_DestroyCondVar(PRCondVar *cvar)
 {
     if (0 > PR_ATOMIC_DECREMENT(&cvar->notify_pending))
     {
-        PRIntn rv = pthread_cond_destroy(&cvar->cv); PR_ASSERT(0 == rv);
+        PRIntn rv = pthread_cond_destroy(&cvar->cv);
 #if defined(DEBUG)
+        PR_ASSERT(0 == rv);
         memset(cvar, 0xaf, sizeof(PRCondVar));
         pt_debug.cvars_destroyed += 1;
+#else
+        (void)rv;
 #endif
         PR_Free(cvar);
     }
 }  /* PR_DestroyCondVar */
 
 PR_IMPLEMENT(PRStatus) PR_WaitCondVar(PRCondVar *cvar, PRIntervalTime timeout)
 {
     PRIntn rv;
@@ -1176,19 +1187,27 @@ PR_IMPLEMENT(PRCondVar*) PRP_NewNakedCon
     PRCondVar *cv;
 
     if (!_pr_initialized) _PR_ImplicitInitialization();
 
     cv = PR_NEW(PRCondVar);
     if (cv != NULL)
     {
         int rv;
-        rv = _PT_PTHREAD_COND_INIT(cv->cv, _pt_cvar_attr); 
+        rv = _PT_PTHREAD_COND_INIT(cv->cv, _pt_cvar_attr);
         PR_ASSERT(0 == rv);
-        cv->lock = _PR_NAKED_CV_LOCK;
+        if (0 == rv)
+        {
+            cv->lock = _PR_NAKED_CV_LOCK;
+        }
+        else
+        {
+            PR_DELETE(cv);
+            cv = NULL;
+        }
     }
     return cv;
 }  /* PRP_NewNakedCondVar */
 
 PR_IMPLEMENT(void) PRP_DestroyNakedCondVar(PRCondVar *cvar)
 {
     int rv;
     rv = pthread_cond_destroy(&cvar->cv); PR_ASSERT(0 == rv);
--- a/nsprpub/pr/src/pthreads/ptthread.c
+++ b/nsprpub/pr/src/pthreads/ptthread.c
@@ -675,17 +675,17 @@ PR_IMPLEMENT(PRThreadState) PR_GetThread
 PR_IMPLEMENT(PRThreadPriority) PR_GetThreadPriority(const PRThread *thred)
 {
     PR_ASSERT(thred != NULL);
     return thred->priority;
 }  /* PR_GetThreadPriority */
 
 PR_IMPLEMENT(void) PR_SetThreadPriority(PRThread *thred, PRThreadPriority newPri)
 {
-    PRIntn rv = -1;
+    PRIntn rv;
 
     PR_ASSERT(NULL != thred);
 
     if ((PRIntn)PR_PRIORITY_FIRST > (PRIntn)newPri)
         newPri = PR_PRIORITY_FIRST;
     else if ((PRIntn)PR_PRIORITY_LAST < (PRIntn)newPri)
         newPri = PR_PRIORITY_LAST;
 
@@ -731,16 +731,18 @@ PR_IMPLEMENT(void) PR_SetThreadPriority(
             /* We don't set pt_schedpriv to EPERM in case errno == EPERM
              * because adjusting the nice value might be permitted for certain
              * ranges but not for others. */
             PR_LOG(_pr_thread_lm, PR_LOG_MIN,
                 ("PR_SetThreadPriority: setpriority failed with error %d",
                  errno));
         }
     }
+#else
+    (void)rv; /* rv is unused */
 #endif
 
     thred->priority = newPri;
 }  /* PR_SetThreadPriority */
 
 PR_IMPLEMENT(PRStatus) PR_Interrupt(PRThread *thred)
 {
     /*
--- a/nsprpub/pr/tests/Makefile.in
+++ b/nsprpub/pr/tests/Makefile.in
@@ -106,16 +106,17 @@ CSRCS =             \
 	poll_er.c		\
 	poll_nm.c		\
 	poll_to.c		\
 	pollable.c		\
 	prfdbl.c		\
 	prftest.c		\
 	prftest1.c		\
 	prftest2.c		\
+	prfz.c   			\
 	primblok.c		\
 	priotest.c		\
 	provider.c		\
 	prpoll.c		\
 	prpollml.c		\
 	pushtop.c		\
 	ranfile.c       \
 	randseed.c      \
--- a/nsprpub/pr/tests/README.TXT
+++ b/nsprpub/pr/tests/README.TXT
@@ -222,16 +222,19 @@ prftest.c
 	Tests printf-like formatting.
 
 prftest1.c
 	Obsolete. Subsumed in prftest.c
 
 prftest2.c
 	Obsolete. Subsumed in prftest.c
 
+prfz.c
+	Tests printf handling of (s)size_t formats
+
 priotest.c
 	Limited use. Tests NSPR thread dispatching priority.
 
 provider.c
 
 prpoll.c
 	Tests PR_Poll().
 
--- a/nsprpub/pr/tests/env.c
+++ b/nsprpub/pr/tests/env.c
@@ -4,16 +4,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /*
 ** File:        env.c
 ** Description: Testing environment variable operations
 **
 */
 #include "prenv.h"
+#include "prmem.h"
 #include "plgetopt.h"
 
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 
 PRIntn  debug = 0;
 PRIntn  verbose = 0;
@@ -108,16 +109,93 @@ int main(int argc, char **argv)
     if ( (NULL == value ) || (strcmp( value, ENVVALUE)))  {
         if (debug) printf( "env: PR_GetEnv() Failed after setting\n" );
         failedAlready = PR_TRUE;
     } else {
         if (verbose) printf("env: PR_GetEnv() worked after setting it. Found: %s\n", value );
     }
 
 /* ---------------------------------------------------------------------- */
+    /* check that PR_DuplicateEnvironment() agrees with PR_GetEnv() */
+    {
+#if defined(XP_UNIX) && (!defined(DARWIN) || defined(HAVE_CRT_EXTERNS_H))
+        static const PRBool expect_failure = PR_FALSE;
+#else
+        static const PRBool expect_failure = PR_TRUE;
+#endif
+        char **i, **dupenv = PR_DuplicateEnvironment();
+
+
+        if ( NULL == dupenv ) {
+            if (expect_failure) {
+                if (verbose) printf("env: PR_DuplicateEnvironment failed, "
+                                    "as expected on this platform.\n");
+            } else {
+                if (debug) printf("env: PR_DuplicateEnvironment() failed.\n");
+                failedAlready = PR_TRUE;
+            }
+        } else {
+            unsigned found = 0;
+
+            if (expect_failure) {
+                if (debug) printf("env: PR_DuplicateEnvironment() succeeded, "
+                                  "but failure is expected on this platform.\n");
+                failedAlready = PR_TRUE;
+            } else {
+                if (verbose) printf("env: PR_DuplicateEnvironment() succeeded.\n");
+            }
+            for (i = dupenv; *i; i++) {
+                char *equals = strchr(*i, '=');
+
+                if ( equals == NULL ) {
+                    if (debug) printf("env: PR_DuplicateEnvironment() returned a string"
+                                      " with no '=': %s\n", *i);
+                    failedAlready = PR_TRUE;
+                } else {
+                    /* We own this string, so we can temporarily alter it */
+                    /* *i is the null-terminated name; equals + 1 is the value */
+                    *equals = '\0';
+
+                    if ( strcmp(*i, ENVNAME) == 0) {
+                        found++;
+                        if (verbose) printf("env: PR_DuplicateEnvironment() found " ENVNAME
+                                            " (%u so far).\n", found);
+                    }
+
+                    /* Multiple values for the same name can't happen, according to POSIX. */
+                    value = PR_GetEnv(*i);
+                    if ( value == NULL ) {
+                        if (debug) printf("env: PR_DuplicateEnvironment() returned a name"
+                                          " which PR_GetEnv() failed to find: %s\n", *i);
+                        failedAlready = PR_TRUE;
+                    } else if ( strcmp(equals + 1, value) != 0) {
+                        if (debug) printf("env: PR_DuplicateEnvironment() returned the wrong"
+                                          " value for %s: expected %s; found %s\n",
+                                          *i, value, equals + 1);
+                        failedAlready = PR_TRUE;
+                    } else {
+                        if (verbose) printf("env: PR_DuplicateEnvironment() agreed with"
+                                            " PR_GetEnv() about %s\n", *i);
+                    }
+                }
+                PR_Free(*i);
+            }
+            PR_Free(dupenv);
+
+            if (found != 1) {
+                if (debug) printf("env: PR_DuplicateEnvironment() found %u entries for " ENVNAME
+                                  " (expected 1)\n", found);
+                failedAlready = PR_TRUE;
+            } else {
+                if (verbose) printf("env: PR_DuplicateEnvironment() found 1 entry for " ENVNAME "\n");
+            }
+        }
+    }
+
+/* ---------------------------------------------------------------------- */
     /* un-set the variable, using RAW name... should not work */
     envBuf = NewBuffer( ENVBUFSIZE );
     sprintf( envBuf, ENVNAME );
     rc = PR_SetEnv( envBuf );
     if ( PR_FAILURE == rc )  {
         if (verbose) printf( "env: PR_SetEnv() not un-set using RAW name. Good!\n");
     } else {
         if (debug) printf("env: PR_SetEnv() un-set using RAW name. Bad!\n" );
new file mode 100644
--- /dev/null
+++ b/nsprpub/pr/tests/prfz.c
@@ -0,0 +1,76 @@
+/* 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/. */
+
+/*
+ * This is a simple test of the PR_fprintf() function for size_t formats.
+ */
+
+#include "prprf.h"
+#include <sys/types.h>
+#include <limits.h>
+#include <string.h>
+
+int
+main(int argc, char **argv)
+{
+    char buffer[128];
+
+    size_t  unsigned_small  = 266;
+    ssize_t signed_small_p  = 943;
+    ssize_t signed_small_n  = -1;
+    size_t  unsigned_max    = SIZE_MAX;
+    size_t  unsigned_min    = 0;
+    ssize_t signed_max      = SSIZE_MAX;
+
+    printf("Test: unsigned small '%%zu' : ");
+    PR_snprintf(buffer, sizeof(buffer), "%zu", unsigned_small);
+    if (strncmp(buffer, "266", sizeof(buffer)) != 0) {
+        printf("Failed, got '%s'\n", buffer);
+        return -1;
+    }
+    printf("OK\n");
+
+    printf("Test: signed small positive '%%zd' : ");
+    PR_snprintf(buffer, sizeof(buffer), "%zd", signed_small_p);
+    if (strncmp(buffer, "943", sizeof(buffer)) != 0) {
+        printf("Failed, got '%s'\n", buffer);
+        return -1;
+    }
+    printf("OK\n");
+        
+    printf("Test: signed small negative '%%zd' : ");
+    PR_snprintf(buffer, sizeof(buffer), "%zd", signed_small_n);
+    if (strncmp(buffer, "-1", sizeof(buffer)) != 0) {
+        printf("Failed, got '%s'\n", buffer);
+        return -1;
+    }
+    printf("OK\n");
+        
+    printf("Test: 0 '%%zu' : ");
+    PR_snprintf(buffer, sizeof(buffer), "%zu", unsigned_min);
+    if (strncmp(buffer, "0", sizeof(buffer)) != 0) {
+        printf("Failed, got '%s'\n", buffer);
+        return -1;
+    }
+    printf("OK\n");
+
+    printf("Test: SIZE_MAX '%%zx' : ");
+    PR_snprintf(buffer, sizeof(buffer), "%zx", unsigned_max);
+    if (strspn(buffer, "f") != sizeof(size_t) * 2) {
+        printf("Failed, got '%s'\n", buffer);
+        return -1;
+    }
+    printf("OK\n");
+        
+    printf("Test: SSIZE_MAX '%%zx' : ");
+    PR_snprintf(buffer, sizeof(buffer), "%zx", signed_max);
+    if (*buffer != '7' ||
+        strspn(buffer + 1, "f") != sizeof(ssize_t) * 2 - 1) {
+        printf("Failed, got '%s'\n", buffer);
+        return -1;
+    }
+    printf("OK\n");
+
+    return 0;
+}
--- a/nsprpub/pr/tests/runtests.pl
+++ b/nsprpub/pr/tests/runtests.pl
@@ -305,16 +305,17 @@ sub win_test_prog {
 "perf",
 "pipeping",
 "pipeping2",
 "pipeself",
 "poll_nm",
 "poll_to",
 "pollable",
 "prftest",
+"prfz",
 "primblok",
 "provider",
 "prpollml",
 "pushtop",
 "ranfile",
 "randseed",
 "reinit",
 "rwlocktest",
--- a/nsprpub/pr/tests/runtests.sh
+++ b/nsprpub/pr/tests/runtests.sh
@@ -135,16 +135,17 @@ peek
 perf
 pipeping
 pipeping2
 pipeself
 poll_nm
 poll_to
 pollable
 prftest
+prfz
 primblok
 provider
 prpollml
 pushtop
 ranfile
 randseed
 reinit
 rwlocktest
--- a/nsprpub/pr/tests/vercheck.c
+++ b/nsprpub/pr/tests/vercheck.c
@@ -18,49 +18,49 @@
 
 #include <stdio.h>
 #include <stdlib.h>
 
 /*
  * This release (4.10.7) is backward compatible with the
  * 4.0.x, 4.1.x, 4.2.x, 4.3.x, 4.4.x, 4.5.x, 4.6.x, 4.7.x,
  * 4.8.x, 4.9.x, 4.10, 4.10.1, 4.10.2, 4.10.3, 4.10.4,
- * 4.10.5, 4.10.6 and 4.10.7 releases.
+ * 4.10.5, 4.10.6, 4.10.7 and 4.10.8 releases.
  * It, of course, is compatible with itself.
  */
 static char *compatible_version[] = {
     "4.0", "4.0.1", "4.1", "4.1.1", "4.1.2", "4.1.3",
     "4.2", "4.2.1", "4.2.2", "4.3", "4.4", "4.4.1",
     "4.5", "4.5.1",
     "4.6", "4.6.1", "4.6.2", "4.6.3", "4.6.4", "4.6.5",
     "4.6.6", "4.6.7", "4.6.8",
     "4.7", "4.7.1", "4.7.2", "4.7.3", "4.7.4", "4.7.5",
     "4.7.6",
     "4.8", "4.8.1", "4.8.2", "4.8.3", "4.8.4", "4.8.5",
     "4.8.6", "4.8.7", "4.8.8", "4.8.9",
     "4.9", "4.9.1", "4.9.2", "4.9.3", "4.9.4", "4.9.5",
     "4.9.6",
     "4.10", "4.10.1", "4.10.2", "4.10.3", "4.10.4",
-    "4.10.5", "4.10.6", "4.10.7",
+    "4.10.5", "4.10.6", "4.10.7", "4.10.8",
     PR_VERSION
 };
 
 /*
  * This release is not backward compatible with the old
  * NSPR 2.1 and 3.x releases.
  *
  * Any release is incompatible with future releases and
  * patches.
  */
 static char *incompatible_version[] = {
     "2.1 19980529",
     "3.0", "3.0.1",
     "3.1", "3.1.1", "3.1.2", "3.1.3",
     "3.5", "3.5.1",
-    "4.10.9",
+    "4.10.10",
     "4.11", "4.11.1",
     "10.0", "11.1", "12.14.20"
 };
 
 int main(int argc, char **argv)
 {
     int idx;
     int num_compatible = sizeof(compatible_version) / sizeof(char *);