Bug 1372579, uplift NSPR_4_16_BETA1, r=me
authorKai Engert <kaie@kuix.de>
Fri, 23 Jun 2017 15:52:30 +0200
changeset 366007 e6c64c4d354bf5cfb0aa5b10ae5edb7ffe6a74e3
parent 366006 e2f93083797764391222f791f64b27627fcaed54
child 366008 c39e7022a80cdea25c8431e5b6b5efbd5a8224e0
push id32090
push usercbook@mozilla.com
push dateMon, 26 Jun 2017 11:27:03 +0000
treeherdermozilla-central@af9a8cebd43f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersme
bugs1372579
milestone56.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1372579, uplift NSPR_4_16_BETA1, r=me UPGRADE_NSPR_RELEASE
nsprpub/TAG-INFO
nsprpub/config/prdepend.h
nsprpub/configure
nsprpub/configure.in
nsprpub/pr/include/md/_linux.cfg
nsprpub/pr/include/prinit.h
nsprpub/pr/include/prtypes.h
nsprpub/pr/src/io/prlayer.c
nsprpub/pr/src/io/prmmap.c
nsprpub/pr/src/io/prscanf.c
nsprpub/pr/src/io/prsocket.c
nsprpub/pr/src/md/unix/unix.c
nsprpub/pr/src/md/unix/uxproces.c
nsprpub/pr/src/md/unix/uxshm.c
nsprpub/pr/src/md/windows/w95sock.c
nsprpub/pr/src/misc/prnetdb.c
nsprpub/pr/src/misc/prtime.c
nsprpub/pr/src/misc/prtpool.c
nsprpub/pr/src/pthreads/ptio.c
nsprpub/pr/tests/vercheck.c
--- a/nsprpub/TAG-INFO
+++ b/nsprpub/TAG-INFO
@@ -1,1 +1,1 @@
-NSPR_4_15_RTM
+NSPR_4_16_BETA1
--- 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
@@ -2483,17 +2483,17 @@ case $target_os in *\ *) target_os=`echo
 # The aliases save the names the user supplied, while $host etc.
 # 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=15
+MOD_MINOR_VERSION=16
 MOD_PATCH_VERSION=0
 NSPR_MODNAME=nspr20
 _HAVE_PTHREADS=
 USE_PTHREADS=
 USE_USER_PTHREADS=
 USE_NSPR_THREADS=
 USE_N32=
 USE_X32=
@@ -6709,16 +6709,18 @@ tools are selected during the Xcode/Deve
     $as_echo "#define XP_UNIX 1" >>confdefs.h
 
     $as_echo "#define FREEBSD 1" >>confdefs.h
 
     $as_echo "#define HAVE_BSD_FLOCK 1" >>confdefs.h
 
     $as_echo "#define HAVE_SOCKLEN_T 1" >>confdefs.h
 
+    $as_echo "#define HAVE_POINTER_LOCALTIME_R 1" >>confdefs.h
+
     CFLAGS="$CFLAGS $(DSO_CFLAGS) -ansi -Wall"
     MOZ_OBJFORMAT=`test -x /usr/bin/objformat && /usr/bin/objformat || echo elf`
     if test "$MOZ_OBJFORMAT" = "elf"; then
         DLL_SUFFIX=so
     else
         DLL_SUFFIX=so.1.0
     fi
     MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
@@ -7319,16 +7321,18 @@ tools are selected during the Xcode/Deve
     $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
 
+    $as_echo "#define HAVE_POINTER_LOCALTIME_R 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"
@@ -7375,16 +7379,18 @@ tools are selected during the Xcode/Deve
     $as_echo "#define XP_UNIX 1" >>confdefs.h
 
     $as_echo "#define OPENBSD 1" >>confdefs.h
 
     $as_echo "#define HAVE_BSD_FLOCK 1" >>confdefs.h
 
     $as_echo "#define HAVE_SOCKLEN_T 1" >>confdefs.h
 
+    $as_echo "#define HAVE_POINTER_LOCALTIME_R 1" >>confdefs.h
+
     CFLAGS="$CFLAGS -ansi -Wall"
     CXXFLAGS="$CXXFLAGS -ansi -Wall"
     DLL_SUFFIX=so.1.0
     DSO_CFLAGS=-fPIC
     MDCPUCFG_H=_openbsd.cfg
     PR_MD_CSRCS=openbsd.c
     OS_LIBS="-lc"
     if test -z "$USE_NSPR_THREADS"; then
--- a/nsprpub/configure.in
+++ b/nsprpub/configure.in
@@ -10,17 +10,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=15
+MOD_MINOR_VERSION=16
 MOD_PATCH_VERSION=0
 NSPR_MODNAME=nspr20
 _HAVE_PTHREADS=
 USE_PTHREADS=
 USE_USER_PTHREADS=
 USE_NSPR_THREADS=
 USE_N32=
 USE_X32=
@@ -1384,16 +1384,17 @@ case "$target" in
     AC_DEFINE(HAVE_BSD_FLOCK)
     AC_DEFINE(HAVE_SOCKLEN_T)
     AC_DEFINE(HAVE_POINTER_LOCALTIME_R)
     changequote(,)
     HOST_DARWIN_MAJOR=`echo "$build_os" | sed -E -e 's/^darwin([0-9]+).*$/\1/'`
     changequote([,])
     if test "$HOST_DARWIN_MAJOR" -ge 15 ; then
         AC_DEFINE(HAS_CONNECTX)
+    fi
     AS='$(CC) -x assembler-with-cpp'
     CFLAGS="$CFLAGS -Wall -fno-common"
     case "${target_cpu}" in
         arm*)
             CPU_ARCH=arm
             ;;
         i*86*|x86_64)
             if test -n "$USE_64"; then
@@ -1554,16 +1555,17 @@ tools are selected during the Xcode/Deve
 *-freebsd*)
     if test -z "$USE_NSPR_THREADS"; then
         USE_PTHREADS=1
     fi
     AC_DEFINE(XP_UNIX)
     AC_DEFINE(FREEBSD)
     AC_DEFINE(HAVE_BSD_FLOCK)
     AC_DEFINE(HAVE_SOCKLEN_T)
+    AC_DEFINE(HAVE_POINTER_LOCALTIME_R)
     CFLAGS="$CFLAGS $(DSO_CFLAGS) -ansi -Wall"
     MOZ_OBJFORMAT=`test -x /usr/bin/objformat && /usr/bin/objformat || echo elf`
     if test "$MOZ_OBJFORMAT" = "elf"; then
         DLL_SUFFIX=so
     else
         DLL_SUFFIX=so.1.0
     fi
     MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
@@ -2114,16 +2116,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)
+    AC_DEFINE(HAVE_POINTER_LOCALTIME_R)
     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"
@@ -2162,16 +2165,17 @@ tools are selected during the Xcode/Deve
     _DEBUG_FLAGS="-gstabs"
 	;;
 
 *-openbsd*)
     AC_DEFINE(XP_UNIX)
     AC_DEFINE(OPENBSD)
     AC_DEFINE(HAVE_BSD_FLOCK)
     AC_DEFINE(HAVE_SOCKLEN_T)
+    AC_DEFINE(HAVE_POINTER_LOCALTIME_R)
     CFLAGS="$CFLAGS -ansi -Wall"
     CXXFLAGS="$CXXFLAGS -ansi -Wall"
     DLL_SUFFIX=so.1.0
     DSO_CFLAGS=-fPIC
     MDCPUCFG_H=_openbsd.cfg
     PR_MD_CSRCS=openbsd.c
     OS_LIBS="-lc"
     if test -z "$USE_NSPR_THREADS"; then
--- a/nsprpub/pr/include/md/_linux.cfg
+++ b/nsprpub/pr/include/md/_linux.cfg
@@ -493,16 +493,19 @@
 #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
 
 #elif defined(__mips__)
 
+/* For _ABI64 */
+#include <sgidefs.h>
+
 #ifdef __MIPSEB__
 #define IS_BIG_ENDIAN 1
 #undef  IS_LITTLE_ENDIAN
 #elif defined(__MIPSEL__)
 #define IS_LITTLE_ENDIAN 1
 #undef  IS_BIG_ENDIAN
 #else
 #error "Unknown MIPS endianness."
--- 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.15"
+#define PR_VERSION  "4.16 Beta"
 #define PR_VMAJOR   4
-#define PR_VMINOR   15
+#define PR_VMINOR   16
 #define PR_VPATCH   0
-#define PR_BETA     PR_FALSE
+#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/prtypes.h
+++ b/nsprpub/pr/include/prtypes.h
@@ -240,26 +240,34 @@ PR_BEGIN_EXTERN_C
 **              PRInt8
 ** DESCRIPTION:
 **  The int8 types are known to be 8 bits each. There is no type that
 **      is equivalent to a plain "char".
 ************************************************************************/
 #if PR_BYTES_PER_BYTE == 1
 typedef unsigned char PRUint8;
 /*
+** There are two scenarios that require us to define PRInt8 as type 'char'.
+** (1)
 ** Some cfront-based C++ compilers do not like 'signed char' and
 ** issue the warning message:
 **     warning: "signed" not implemented (ignored)
 ** For these compilers, we have to define PRInt8 as plain 'char'.
 ** Make sure that plain 'char' is indeed signed under these compilers.
+** (2)
+** Mozilla C++ code expects the PRInt{N} and int{N}_t types to match (see bug
+** 634793). If a platform defines int8_t as 'char', but NSPR defines it as
+** 'signed char', it results in a type mismatch.
+** On such platforms we define PRInt8 as 'char' to avoid the mismatch. 
 */
-#if (defined(HPUX) && defined(__cplusplus) \
+#if (defined(HPUX) && defined(__cplusplus) /* reason 1*/ \
         && !defined(__GNUC__) && __cplusplus < 199707L) \
-    || (defined(SCO) && defined(__cplusplus) \
-        && !defined(__GNUC__) && __cplusplus == 1L)
+    || (defined(SCO) && defined(__cplusplus) /* reason 1 */ \
+        && !defined(__GNUC__) && __cplusplus == 1L) \
+    || (defined(__sun) && defined(__cplusplus)) /* reason 2 */
 typedef char PRInt8;
 #else
 typedef signed char PRInt8;
 #endif
 #else
 #error No suitable type for PRInt8/PRUint8
 #endif
 
--- a/nsprpub/pr/src/io/prlayer.c
+++ b/nsprpub/pr/src/io/prlayer.c
@@ -42,17 +42,18 @@ static PRStatus PR_CALLBACK pl_TopClose 
 	if (PR_IO_LAYER_HEAD == fd->identity) {
 		/*
 		 * new style stack; close all the layers, before deleting the
 		 * stack head
 		 */
 		rv = fd->lower->methods->close(fd->lower);
 		_PR_DestroyIOLayer(fd);
 		return rv;
-	} else if ((fd->higher) && (PR_IO_LAYER_HEAD == fd->higher->identity)) {
+	}
+	if ((fd->higher) && (PR_IO_LAYER_HEAD == fd->higher->identity)) {
 		/*
 		 * lower layers of new style stack
 		 */
 		lower = fd->lower;
 		/*
 		 * pop and cleanup current layer
 		 */
     	top = PR_PopIOLayer(fd->higher, PR_TOP_IO_LAYER);
@@ -196,26 +197,26 @@ static PRFileDesc* PR_CALLBACK pl_TopAcc
 
     newfd = (fd->lower->methods->accept)(fd->lower, addr, timeout);
     if (NULL == newfd)
     {
         PR_DELETE(newstack);
         return NULL;
     }
 
-    if (newstyle_stack) {
-		newstack->lower = newfd;
-		newfd->higher = newstack;
-		return newstack;
-	} else {
-		/* this PR_PushIOLayer call cannot fail */
-		rv = PR_PushIOLayer(newfd, PR_TOP_IO_LAYER, newstack);
-		PR_ASSERT(PR_SUCCESS == rv);
-    	return newfd;  /* that's it */
-	}
+    if (newstyle_stack)
+    {
+        newstack->lower = newfd;
+        newfd->higher = newstack;
+        return newstack;
+    }
+    /* this PR_PushIOLayer call cannot fail */
+    rv = PR_PushIOLayer(newfd, PR_TOP_IO_LAYER, newstack);
+    PR_ASSERT(PR_SUCCESS == rv);
+    return newfd;  /* that's it */
 }
 
 static PRStatus PR_CALLBACK pl_DefBind (PRFileDesc *fd, const PRNetAddr *addr)
 {
     PR_ASSERT(fd != NULL);
     PR_ASSERT(fd->lower != NULL);
 
     return (fd->lower->methods->bind)(fd->lower, addr);
@@ -321,22 +322,21 @@ static PRInt32 PR_CALLBACK pl_DefAcceptr
         PR_DELETE(newstack);
         return nbytes;
     }
     if (newstyle_stack) {
 		newstack->lower = *nd;
 		(*nd)->higher = newstack;
 		*nd = newstack;
 		return nbytes;
-	} else {
-		/* this PR_PushIOLayer call cannot fail */
-		rv = PR_PushIOLayer(*nd, PR_TOP_IO_LAYER, newstack);
-		PR_ASSERT(PR_SUCCESS == rv);
-		return nbytes;
 	}
+    /* this PR_PushIOLayer call cannot fail */
+    rv = PR_PushIOLayer(*nd, PR_TOP_IO_LAYER, newstack);
+    PR_ASSERT(PR_SUCCESS == rv);
+    return nbytes;
 }
 
 static PRInt32 PR_CALLBACK pl_DefTransmitfile (
     PRFileDesc *sd, PRFileDesc *fd, const void *headers, PRInt32 hlen,
     PRTransmitFileFlags flags, PRIntervalTime t)
 {
     PR_ASSERT(sd != NULL);
     PR_ASSERT(sd->lower != NULL);
@@ -489,20 +489,19 @@ PR_IMPLEMENT(PRFileDesc*) PR_CreateIOLay
  * _PR_DestroyIOLayer
  *		Delete the stack head of a new style stack.
  */
 
 static PRStatus _PR_DestroyIOLayer(PRFileDesc *stack)
 {
     if (NULL == stack)
         return PR_FAILURE;
-    else {
-        PR_DELETE(stack);
-    	return PR_SUCCESS;
-    }
+
+    PR_DELETE(stack);
+    return PR_SUCCESS;
 }  /* _PR_DestroyIOLayer */
 
 PR_IMPLEMENT(PRStatus) PR_PushIOLayer(
     PRFileDesc *stack, PRDescIdentity id, PRFileDesc *fd)
 {
     PRFileDesc *insert = PR_GetIdentitiesLayer(stack, id);
 
     PR_ASSERT(fd != NULL);
@@ -699,29 +698,29 @@ PR_IMPLEMENT(const char*) PR_GetNameForI
 }  /* PR_GetNameForIdentity */
 
 PR_IMPLEMENT(PRDescIdentity) PR_GetLayersIdentity(PRFileDesc* fd)
 {
     PR_ASSERT(NULL != fd);
     if (PR_IO_LAYER_HEAD == fd->identity) {
     	PR_ASSERT(NULL != fd->lower);
     	return fd->lower->identity;
-	} else
-    	return fd->identity;
+	}
+    return fd->identity;
 }  /* PR_GetLayersIdentity */
 
 PR_IMPLEMENT(PRFileDesc*) PR_GetIdentitiesLayer(PRFileDesc* fd, PRDescIdentity id)
 {
     PRFileDesc *layer = fd;
 
     if (PR_TOP_IO_LAYER == id) {
-    	if (PR_IO_LAYER_HEAD == fd->identity)
-			return fd->lower;
-		else 
-			return fd;
+      if (PR_IO_LAYER_HEAD == fd->identity) {
+          return fd->lower;
+      }
+      return fd;
 	}
 
     for (layer = fd; layer != NULL; layer = layer->lower)
     {
         if (id == layer->identity) return layer;
     }
     for (layer = fd; layer != NULL; layer = layer->higher)
     {
--- a/nsprpub/pr/src/io/prmmap.c
+++ b/nsprpub/pr/src/io/prmmap.c
@@ -19,27 +19,26 @@ PR_IMPLEMENT(PRFileMap *) PR_CreateFileM
     PRFileMapProtect prot)
 {
     PRFileMap *fmap;
 
     PR_ASSERT(prot == PR_PROT_READONLY || prot == PR_PROT_READWRITE
             || prot == PR_PROT_WRITECOPY);
     fmap = PR_NEWZAP(PRFileMap);
     if (NULL == fmap) {
-	PR_SetError(PR_OUT_OF_MEMORY_ERROR, 0);
-	return NULL;
+      PR_SetError(PR_OUT_OF_MEMORY_ERROR, 0);
+      return NULL;
     }
     fmap->fd = fd;
     fmap->prot = prot;
     if (_PR_MD_CREATE_FILE_MAP(fmap, size) == PR_SUCCESS) {
-	return fmap;
-    } else {
+      return fmap;
+    }
 	PR_DELETE(fmap);
 	return NULL;
-    }
 }
 
 PR_IMPLEMENT(PRInt32) PR_GetMemMapAlignment(void)
 {
     return _PR_MD_GET_MEM_MAP_ALIGNMENT();
 }
 
 PR_IMPLEMENT(void *) PR_MemMap(
--- a/nsprpub/pr/src/io/prscanf.c
+++ b/nsprpub/pr/src/io/prscanf.c
@@ -404,17 +404,18 @@ Convert(ScanfState *state, const char *f
             }
             if (state->width == 0) {
                 state->width = 1;
             }
             for (; state->width > 0; state->width--) {
                 ch = GET(state);
                 if (ch == EOF) {
                     return NULL;
-                } else if (state->assign) {
+                }
+                if (state->assign) {
                     *cArg++ = ch;
                 }
             }
             if (state->assign) {
                 state->converted = PR_TRUE;
             }
             break;
         case 'p':
@@ -597,20 +598,19 @@ DoScanf(ScanfState *state, const char *f
 
 static int
 StringGetChar(void *stream)
 {
     char *cPtr = *((char **) stream);
 
     if (*cPtr == '\0') {
         return EOF;
-    } else {
-        *((char **) stream) = cPtr + 1;
-        return (unsigned char) *cPtr;
     }
+    *((char **) stream) = cPtr + 1;
+    return (unsigned char) *cPtr;
 }
 
 static void
 StringUngetChar(void *stream, int ch)
 {
     char *cPtr = *((char **) stream);
 
     if (ch != EOF) {
--- a/nsprpub/pr/src/io/prsocket.c
+++ b/nsprpub/pr/src/io/prsocket.c
@@ -335,17 +335,17 @@ static PRStatus PR_CALLBACK SocketConnec
                 _PR_MD_MAP_SETSOCKOPT_ERROR(err);
                 return PR_FAILURE;
             }
             return PR_SUCCESS;
         } else {
             err = WSAGetLastError();
             PR_LOG(_pr_io_lm, PR_LOG_MIN,
                ("SocketConnectContinue GetOverlappedResult failed %d\n", err));
-            if (err != ERROR_IO_PENDING) {
+            if (err != ERROR_IO_INCOMPLETE) {
                 _PR_MD_MAP_CONNECT_ERROR(err);
                 fd->secret->overlappedActive = FALSE;
                 return PR_FAILURE;
             } else {
                 PR_SetError(PR_IN_PROGRESS_ERROR, 0);
                 return PR_FAILURE;
             }
         }
--- a/nsprpub/pr/src/md/unix/unix.c
+++ b/nsprpub/pr/src/md/unix/unix.c
@@ -3311,42 +3311,42 @@ int _MD_unix_get_nonblocking_connect_err
             int err;
             _PRSockLen_t optlen = sizeof(err);
 
             if (getsockopt(osfd, SOL_SOCKET, SO_ERROR,
                     (char *) &err, &optlen) == -1) {
                 return errno;
             } else {
                 return err;
-            }		
+            }
         }
     } else {
         return ECONNREFUSED;
-    }	
+    }
 #elif defined(UNIXWARE)
     /*
      * getsockopt() fails with EPIPE, so use getmsg() instead.
      */
 
     int rv;
     int flags = 0;
     rv = getmsg(osfd, NULL, NULL, &flags);
     PR_ASSERT(-1 == rv || 0 == rv);
     if (-1 == rv && errno != EAGAIN && errno != EWOULDBLOCK) {
-        return errno;
+      return errno;
     }
-    return 0;  /* no error */
+    return 0; /* no error */
 #else
-    int err;
-    _PRSockLen_t optlen = sizeof(err);
-    if (getsockopt(osfd, SOL_SOCKET, SO_ERROR, (char *) &err, &optlen) == -1) {
-        return errno;
-    } else {
-        return err;
-    }
+  int err;
+  _PRSockLen_t optlen = sizeof(err);
+  if (getsockopt(osfd, SOL_SOCKET, SO_ERROR, (char*)&err, &optlen) == -1) {
+    return errno;
+  }
+  return err;
+
 #endif
 }
 
 /************************************************************************/
 
 /*
 ** Special hacks for xlib. Xlib/Xt/Xm is not re-entrant nor is it thread
 ** safe.  Unfortunately, neither is mozilla. To make these programs work
--- a/nsprpub/pr/src/md/unix/uxproces.c
+++ b/nsprpub/pr/src/md/unix/uxproces.c
@@ -242,23 +242,24 @@ ForkAndExec(
 #endif
     if ((pid_t) -1 == process->md.pid) {
         PR_SetError(PR_INSUFFICIENT_RESOURCES_ERROR, errno);
         PR_DELETE(process);
         if (newEnvp) {
             PR_DELETE(newEnvp);
         }
         return NULL;
-    } else if (0 == process->md.pid) {  /* the child process */
-        /*
-         * If the child process needs to exit, it must call _exit().
-         * Do not call exit(), because exit() will flush and close
-         * the standard I/O file descriptors, and hence corrupt
-         * the parent process's standard I/O data structures.
-         */
+    }
+    if (0 == process->md.pid) {  /* the child process */
+      /*
+       * If the child process needs to exit, it must call _exit().
+       * Do not call exit(), because exit() will flush and close
+       * the standard I/O file descriptors, and hence corrupt
+       * the parent process's standard I/O data structures.
+       */
 
 #if !defined(NTO) && !defined(SYMBIAN)
         if (attr) {
             /* the osfd's to redirect stdin, stdout, and stderr to */
             int in_osfd = -1, out_osfd = -1, err_osfd = -1;
 
             if (attr->stdinFd
                     && attr->stdinFd->secret->md.osfd != 0) {
@@ -493,20 +494,19 @@ ExtractExitStatus(int rawExitStatus)
      * for waitpid, so these two events should not be reported.
      */
     PR_ASSERT(!WIFSTOPPED(rawExitStatus));
 #ifdef WIFCONTINUED
     PR_ASSERT(!WIFCONTINUED(rawExitStatus));
 #endif
     if (WIFEXITED(rawExitStatus)) {
 	return WEXITSTATUS(rawExitStatus);
-    } else {
+    }
 	PR_ASSERT(WIFSIGNALED(rawExitStatus));
 	return _PR_SIGNALED_EXITSTATUS;
-    }
 }
 
 static void
 ProcessReapedChildInternal(pid_t pid, int status)
 {
     pr_PidRecord *pRec;
 
     pRec = FindPidTable(pid);
@@ -619,33 +619,33 @@ static void WaitPidDaemonThread(void *un
 	PR_Lock(pr_wp.ml);
 #endif
 	    
         do {
             rv = read(pr_wp.pipefd[0], buf, sizeof(buf));
         } while (sizeof(buf) == rv || (-1 == rv && EINTR == errno));
 
 #ifdef _PR_SHARE_CLONES
-	PR_Unlock(pr_wp.ml);
 	while ((op = pr_wp.opHead) != NULL) {
+	    PR_Unlock(pr_wp.ml);
 	    op->process = ForkAndExec(op->path, op->argv,
 		    op->envp, op->attr);
 	    if (NULL == op->process) {
 		op->prerror = PR_GetError();
 		op->oserror = PR_GetOSError();
 	    }
 	    PR_Lock(pr_wp.ml);
 	    pr_wp.opHead = op->next;
 	    if (NULL == pr_wp.opHead) {
 		pr_wp.opTail = NULL;
 	    }
 	    op->done = PR_TRUE;
 	    PR_NotifyCondVar(op->doneCV);
-	    PR_Unlock(pr_wp.ml);
 	}
+	PR_Unlock(pr_wp.ml);
 #endif
 
 	while (1) {
 	    do {
 	        pid = waitpid((pid_t) -1, &status, WNOHANG);
 	    } while ((pid_t) -1 == pid && EINTR == errno);
 	    if (0 == pid) break;
 	    if ((pid_t) -1 == pid) {
--- a/nsprpub/pr/src/md/unix/uxshm.c
+++ b/nsprpub/pr/src/md/unix/uxshm.c
@@ -71,18 +71,18 @@ extern PRSharedMemory * _MD_OpenSharedMe
         PR_SetError(PR_OUT_OF_MEMORY_ERROR, 0 );
         PR_LOG(_pr_shm_lm, PR_LOG_DEBUG, ( "PR_OpenSharedMemory: New shm->ipcname out of memory")); 
         PR_DELETE( shm );
         return( NULL );
     }
 
     /* copy args to struct */
     strcpy( shm->ipcname, ipcname );
-    shm->size = size; 
-    shm->mode = mode; 
+    shm->size = size;
+    shm->mode = mode;
     shm->flags = flags;
     shm->ident = _PR_SHM_IDENT;
 
     /* create the file first */
     if ( flags & PR_SHM_CREATE )  {
         int osfd = open( shm->ipcname, (O_RDWR | O_CREAT), shm->mode );
         if ( -1 == osfd ) {
             _PR_MD_MAP_OPEN_ERROR( errno );
@@ -495,40 +495,42 @@ extern PRFileMap* _md_OpenAnonFileMap(
 #endif
         genName = PR_smprintf( NSPR_AFM_FILENAME,
             dirName, (int) pid, tid, incr );
         if ( NULL == genName ) {
             PR_LOG( _pr_shma_lm, PR_LOG_DEBUG,
                 ("_md_OpenAnonFileMap(): PR_snprintf(): failed, generating filename"));
             goto Finished;
         }
-        
+
         /* create the file */
-        osfd = open( genName, (O_CREAT | O_EXCL | O_RDWR), mode );
-        if ( -1 == osfd ) {
-            if ( EEXIST == errno )  {
-                PR_smprintf_free( genName );
-                continue; /* name exists, try again */
-            } else {
-                _PR_MD_MAP_OPEN_ERROR( errno );
-                PR_LOG( _pr_shma_lm, PR_LOG_DEBUG,
-                    ("_md_OpenAnonFileMap(): open(): failed, filename: %s, errno: %d", 
-                        genName, PR_GetOSError()));
-                PR_smprintf_free( genName );
-                goto Finished;
-            }
+        osfd = open(genName, (O_CREAT | O_EXCL | O_RDWR), mode);
+        if (-1 == osfd) {
+          if (EEXIST == errno) {
+            PR_smprintf_free(genName);
+            continue; /* name exists, try again */
+          }
+          _PR_MD_MAP_OPEN_ERROR(errno);
+          PR_LOG(
+            _pr_shma_lm,
+            PR_LOG_DEBUG,
+            ("_md_OpenAnonFileMap(): open(): failed, filename: %s, errno: %d",
+             genName,
+             PR_GetOSError()));
+          PR_smprintf_free(genName);
+          goto Finished;
         }
         break; /* name generation and open successful, break; */
     } /* end for() */
 
-    if ( incr == maxTries ) {
-        PR_ASSERT( -1 == osfd );
-        PR_ASSERT( EEXIST == errno );
-        _PR_MD_MAP_OPEN_ERROR( errno );
-        goto Finished;
+    if (incr == maxTries) {
+      PR_ASSERT(-1 == osfd);
+      PR_ASSERT(EEXIST == errno);
+      _PR_MD_MAP_OPEN_ERROR(errno);
+      goto Finished;
     }
 
     urc = unlink( genName );
 #if defined(SYMBIAN) && defined(__WINS__)
     /* If it is being used by the system or another process, Symbian OS 
      * Emulator(WINS) considers this an error. */
     if ( -1 == urc && EACCES != errno ) {
 #else
--- a/nsprpub/pr/src/md/windows/w95sock.c
+++ b/nsprpub/pr/src/md/windows/w95sock.c
@@ -408,22 +408,19 @@ PRInt32
             _PR_MD_MAP_SETSOCKOPT_ERROR(err);
         }
         return -1;
     }
 
     /* ConnectEx requires the socket to be initially bound. We will use INADDR_ANY. */
     PRNetAddr bindAddr;
     memset(&bindAddr, 0, sizeof(bindAddr));
-    if (addr->raw.family == PR_AF_INET) {
-        bindAddr.inet.family = PR_AF_INET;
-    } else if (addr->raw.family == PR_AF_INET6) {
-        bindAddr.ipv6.family = PR_AF_INET6;
-    }
-    rv = bind((SOCKET)osfd, (SOCKADDR*) &bindAddr, sizeof(bindAddr));
+    bindAddr.raw.family = addr->raw.family;
+
+    rv = bind((SOCKET)osfd, (const struct sockaddr *)&(bindAddr.inet), PR_NETADDR_SIZE(&bindAddr));
     if (rv != 0) {
         err = WSAGetLastError();
         PR_LOG(_pr_io_lm, PR_LOG_MIN,
                ("_PR_MD_TCPSENDTO error bind failed %d\n", err));
         _PR_MD_MAP_SETSOCKOPT_ERROR(err);
         return -1;
     }
 
@@ -465,27 +462,30 @@ PRInt32
              * the final result of ConnectEx call. */
             fd->secret->overlappedActive = PR_TRUE;
             _PR_MD_MAP_CONNECT_ERROR(WSAEWOULDBLOCK);
             /* ConnectEx will copy supplied data to a internal buffer and send
              * them during Fast Open or after connect. Therefore we can assumed
              * this data already send. */
             return amount;
         }
-        while (err == ERROR_IO_PENDING) {
+        // err is ERROR_IO_PENDING and socket is blocking, so query
+        // GetOverlappedResult.
+        err = ERROR_IO_INCOMPLETE;
+        while (err == ERROR_IO_INCOMPLETE) {
             rv = socket_io_wait(osfd, WRITE_FD, timeout);
             if ( rv < 0 ) {
                 return -1;
             }
             rv = GetOverlappedResult(osfd, &fd->secret->ol, &rvSent, FALSE);
             if ( rv == TRUE ) {
                 return rvSent;
             } else {
                 err = WSAGetLastError();
-                if (err != ERROR_IO_PENDING) {
+                if (err != ERROR_IO_INCOMPLETE) {
                     _PR_MD_MAP_CONNECT_ERROR(err);
                     return -1;
                 }
             }
         }
     }
     return -1;
 }
--- a/nsprpub/pr/src/misc/prnetdb.c
+++ b/nsprpub/pr/src/misc/prnetdb.c
@@ -1478,39 +1478,42 @@ PR_IMPLEMENT(PRStatus) PR_SetNetAddr(
 
 PR_IMPLEMENT(PRBool)
 PR_IsNetAddrType(const PRNetAddr *addr, PRNetAddrValue val)
 {
     if (addr->raw.family == PR_AF_INET6) {
         if (val == PR_IpAddrAny) {
 			if (_PR_IN6_IS_ADDR_UNSPECIFIED((PRIPv6Addr *)&addr->ipv6.ip)) {
             	return PR_TRUE;
-			} else if (_PR_IN6_IS_ADDR_V4MAPPED((PRIPv6Addr *)&addr->ipv6.ip)
-					&& _PR_IN6_V4MAPPED_TO_IPADDR((PRIPv6Addr *)&addr->ipv6.ip)
-							== htonl(INADDR_ANY)) {
-            	return PR_TRUE;
+			}
+            if (_PR_IN6_IS_ADDR_V4MAPPED((PRIPv6Addr *)&addr->ipv6.ip)
+                && _PR_IN6_V4MAPPED_TO_IPADDR((PRIPv6Addr *)&addr->ipv6.ip)
+                == htonl(INADDR_ANY)) {
+                return PR_TRUE;
 			}
         } else if (val == PR_IpAddrLoopback) {
             if (_PR_IN6_IS_ADDR_LOOPBACK((PRIPv6Addr *)&addr->ipv6.ip)) {
             	return PR_TRUE;
-			} else if (_PR_IN6_IS_ADDR_V4MAPPED((PRIPv6Addr *)&addr->ipv6.ip)
-					&& _PR_IN6_V4MAPPED_TO_IPADDR((PRIPv6Addr *)&addr->ipv6.ip)
-							== htonl(INADDR_LOOPBACK)) {
-            	return PR_TRUE;
+			}
+            if (_PR_IN6_IS_ADDR_V4MAPPED((PRIPv6Addr *)&addr->ipv6.ip)
+                && _PR_IN6_V4MAPPED_TO_IPADDR((PRIPv6Addr *)&addr->ipv6.ip)
+                == htonl(INADDR_LOOPBACK)) {
+                return PR_TRUE;
 			}
         } else if (val == PR_IpAddrV4Mapped
                 && _PR_IN6_IS_ADDR_V4MAPPED((PRIPv6Addr *)&addr->ipv6.ip)) {
             return PR_TRUE;
         }
     } else {
         if (addr->raw.family == AF_INET) {
             if (val == PR_IpAddrAny && addr->inet.ip == htonl(INADDR_ANY)) {
                 return PR_TRUE;
-            } else if (val == PR_IpAddrLoopback
-                    && addr->inet.ip == htonl(INADDR_LOOPBACK)) {
+            }
+            if (val == PR_IpAddrLoopback
+                && addr->inet.ip == htonl(INADDR_LOOPBACK)) {
                 return PR_TRUE;
             }
         }
     }
     return PR_FALSE;
 }
 
 extern int pr_inet_aton(const char *cp, PRUint32 *addr);
--- a/nsprpub/pr/src/misc/prtime.c
+++ b/nsprpub/pr/src/misc/prtime.c
@@ -274,18 +274,17 @@ PR_ImplodeTime(const PRExplodedTime *exp
  *
  *-------------------------------------------------------------------------
  */
 
 static int IsLeapYear(PRInt16 year)
 {
     if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0)
         return 1;
-    else
-        return 0;
+    return 0;
 }
 
 /*
  * 'secOffset' should be less than 86400 (i.e., a day).
  * 'time' should point to a normalized PRExplodedTime.
  */
 
 static void
@@ -1231,37 +1230,37 @@ PR_ParseTimeStringToExplodedTime(
                           {
                                 if (hour >= 0 && min >= 0) /* already got it */
                                   break;
 
                                 /* We have seen "[0-9]+:", so this is probably HH:MM[:SS] */
                                 if ((end - rest) > 2)
                                   /* it is [0-9][0-9][0-9]+: */
                                   break;
-                                else if ((end - rest) == 2)
+                                if ((end - rest) == 2)
                                   tmp_hour = ((rest[0]-'0')*10 +
                                                           (rest[1]-'0'));
                                 else
                                   tmp_hour = (rest[0]-'0');
 
                                 /* move over the colon, and parse minutes */
 
                                 rest = ++end;
                                 while (*end >= '0' && *end <= '9')
                                   end++;
 
                                 if (end == rest)
                                   /* no digits after first colon? */
                                   break;
-                                else if ((end - rest) > 2)
+                                if ((end - rest) > 2)
                                   /* it is [0-9][0-9][0-9]+: */
                                   break;
-                                else if ((end - rest) == 2)
+                                if ((end - rest) == 2)
                                   tmp_min = ((rest[0]-'0')*10 +
-                                                         (rest[1]-'0'));
+                                             (rest[1]-'0'));
                                 else
                                   tmp_min = (rest[0]-'0');
 
                                 /* now go for seconds */
                                 rest = end;
                                 if (*rest == ':')
                                   rest++;
                                 end = rest;
@@ -1269,17 +1268,17 @@ PR_ParseTimeStringToExplodedTime(
                                   end++;
 
                                 if (end == rest)
                                   /* no digits after second colon - that's ok. */
                                   ;
                                 else if ((end - rest) > 2)
                                   /* it is [0-9][0-9][0-9]+: */
                                   break;
-                                else if ((end - rest) == 2)
+                                if ((end - rest) == 2)
                                   tmp_sec = ((rest[0]-'0')*10 +
                                                          (rest[1]-'0'));
                                 else
                                   tmp_sec = (rest[0]-'0');
 
                                 /* If we made it here, we've parsed hour and min,
                                    and possibly sec, so it worked as a unit. */
 
@@ -1303,17 +1302,17 @@ PR_ParseTimeStringToExplodedTime(
                                   }
 
                                 hour = tmp_hour;
                                 min = tmp_min;
                                 sec = tmp_sec;
                                 rest = end;
                                 break;
                           }
-                        else if ((*end == '/' || *end == '-') &&
+                        if ((*end == '/' || *end == '-') &&
                                          end[1] >= '0' && end[1] <= '9')
                           {
                                 /* Perhaps this is 6/16/95, 16/6/95, 6-16-95, or 16-6-95
                                    or even 95-06-05...
                                    #### But it doesn't handle 1995-06-22.
                                  */
                                 int n1, n2, n3;
                                 const char *s;
@@ -2009,29 +2008,27 @@ pr_WeekOfYear(const PRExplodedTime* time
    int dayOfYear;
 
   /* Get the day of the year for the given time then adjust it to represent the
    * first day of the week containing the given time.
    */
   dayOfWeek = time->tm_wday - firstDayOfWeek;
   if (dayOfWeek < 0)
     dayOfWeek += 7;
-  
+
   dayOfYear = time->tm_yday - dayOfWeek;
 
-
   if( dayOfYear <= 0 )
   {
      /* If dayOfYear is <= 0, it is in the first partial week of the year. */
      return 0;
   }
-  else
-  {
-     /* Count the number of full weeks ( dayOfYear / 7 ) then add a week if there
-      * are any days left over ( dayOfYear % 7 ).  Because we are only counting to
-      * the first day of the week containing the given time, rather than to the
-      * actual day representing the given time, any days in week 0 will be "absorbed"
-      * as extra days in the given week.
-      */
-     return (dayOfYear / 7) + ( (dayOfYear % 7) == 0 ? 0 : 1 );
-  }
+
+  /* Count the number of full weeks ( dayOfYear / 7 ) then add a week if there
+   * are any days left over ( dayOfYear % 7 ).  Because we are only counting to
+   * the first day of the week containing the given time, rather than to the
+   * actual day representing the given time, any days in week 0 will be "absorbed"
+   * as extra days in the given week.
+   */
+  return (dayOfYear / 7) + ( (dayOfYear % 7) == 0 ? 0 : 1 );
+
 }
 
--- a/nsprpub/pr/src/misc/prtpool.c
+++ b/nsprpub/pr/src/misc/prtpool.c
@@ -857,26 +857,26 @@ PR_QueueJob_Connect(PRThreadPool *tpool,
 {
 	PRStatus rv;
 	PRErrorCode err;
 
 	rv = PR_Connect(iod->socket, addr, PR_INTERVAL_NO_WAIT);
 	if ((rv == PR_FAILURE) && ((err = PR_GetError()) == PR_IN_PROGRESS_ERROR)){
 		/* connection pending */
 		return(queue_io_job(tpool, iod, fn, arg, joinable, JOB_IO_CONNECT));
-	} else {
-		/*
-		 * connection succeeded or failed; add to jobq right away
-		 */
-		if (rv == PR_FAILURE)
-			iod->error = err;
-		else
-			iod->error = 0;
-		return(PR_QueueJob(tpool, fn, arg, joinable));
 	}
+    /*
+     * connection succeeded or failed; add to jobq right away
+     */
+    if (rv == PR_FAILURE)
+      iod->error = err;
+    else
+      iod->error = 0;
+    return(PR_QueueJob(tpool, fn, arg, joinable));
+
 }
 
 /* queue a job, when a timer expires */
 PR_IMPLEMENT(PRJob *)
 PR_QueueJob_Timer(PRThreadPool *tpool, PRIntervalTime timeout,
 							PRJobFn fn, void * arg, PRBool joinable)
 {
 	PRIntervalTime now;
--- a/nsprpub/pr/src/pthreads/ptio.c
+++ b/nsprpub/pr/src/pthreads/ptio.c
@@ -819,17 +819,17 @@ retry:
     {
         char *bp = (char*)op->arg2.buffer;
         bp += bytes;  /* adjust the buffer pointer */
         op->arg2.buffer = bp;
         op->result.code += bytes;  /* accumulate the number sent */
         op->arg3.amount -= bytes;  /* and reduce the required count */
         return (0 == op->arg3.amount) ? PR_TRUE : PR_FALSE;
     }
-    else if ((EWOULDBLOCK != op->syserrno) && (EAGAIN != op->syserrno))
+    if ((EWOULDBLOCK != op->syserrno) && (EAGAIN != op->syserrno))
     {
         op->result.code = -1;
         return PR_TRUE;
     }
     else return PR_FALSE;
 }  /* pt_send_cont */
 
 static PRBool pt_write_cont(pt_Continuation *op, PRInt16 revents)
@@ -848,17 +848,17 @@ static PRBool pt_write_cont(pt_Continuat
     {
         char *bp = (char*)op->arg2.buffer;
         bp += bytes;  /* adjust the buffer pointer */
         op->arg2.buffer = bp;
         op->result.code += bytes;  /* accumulate the number sent */
         op->arg3.amount -= bytes;  /* and reduce the required count */
         return (0 == op->arg3.amount) ? PR_TRUE : PR_FALSE;
     }
-    else if ((EWOULDBLOCK != op->syserrno) && (EAGAIN != op->syserrno))
+    if ((EWOULDBLOCK != op->syserrno) && (EAGAIN != op->syserrno))
     {
         op->result.code = -1;
         return PR_TRUE;
     }
     else return PR_FALSE;
 }  /* pt_write_cont */
 
 static PRBool pt_writev_cont(pt_Continuation *op, PRInt16 revents)
@@ -890,17 +890,17 @@ static PRBool pt_writev_cont(pt_Continua
                 break;  /* go off and do that */
             }
             bytes -= iov[iov_index].iov_len;  /* that element's consumed */
         }
         op->arg2.buffer = &iov[iov_index];  /* new start of array */
         op->arg3.amount -= iov_index;  /* and array length */
         return (0 == op->arg3.amount) ? PR_TRUE : PR_FALSE;
     }
-    else if ((EWOULDBLOCK != op->syserrno) && (EAGAIN != op->syserrno))
+    if ((EWOULDBLOCK != op->syserrno) && (EAGAIN != op->syserrno))
     {
         op->result.code = -1;
         return PR_TRUE;
     }
     else return PR_FALSE;
 }  /* pt_writev_cont */
 
 static PRBool pt_sendto_cont(pt_Continuation *op, PRInt16 revents)
@@ -913,17 +913,17 @@ static PRBool pt_sendto_cont(pt_Continua
     {
         char *bp = (char*)op->arg2.buffer;
         bp += bytes;  /* adjust the buffer pointer */
         op->arg2.buffer = bp;
         op->result.code += bytes;  /* accumulate the number sent */
         op->arg3.amount -= bytes;  /* and reduce the required count */
         return (0 == op->arg3.amount) ? PR_TRUE : PR_FALSE;
     }
-    else if ((EWOULDBLOCK != op->syserrno) && (EAGAIN != op->syserrno))
+    if ((EWOULDBLOCK != op->syserrno) && (EAGAIN != op->syserrno))
     {
         op->result.code = -1;
         return PR_TRUE;
     }
     else return PR_FALSE;
 }  /* pt_sendto_cont */
 
 static PRBool pt_recvfrom_cont(pt_Continuation *op, PRInt16 revents)
@@ -2869,63 +2869,61 @@ static PRStatus pt_GetSockName(PRFileDes
 
     if (pt_TestAbort()) return PR_FAILURE;
 
     rv = getsockname(
         fd->secret->md.osfd, (struct sockaddr*)addr, &addr_len);
     if (rv == -1) {
         pt_MapError(_PR_MD_MAP_GETSOCKNAME_ERROR, errno);
         return PR_FAILURE;
-    } else {
+    }
 #ifdef _PR_HAVE_SOCKADDR_LEN
-        /* ignore the sa_len field of struct sockaddr */
-        if (addr)
-        {
-            addr->raw.family = ((struct sockaddr*)addr)->sa_family;
-        }
+    /* ignore the sa_len field of struct sockaddr */
+    if (addr)
+    {
+        addr->raw.family = ((struct sockaddr*)addr)->sa_family;
+    }
 #endif /* _PR_HAVE_SOCKADDR_LEN */
 #ifdef _PR_INET6
-		if (AF_INET6 == addr->raw.family)
-			addr->raw.family = PR_AF_INET6;
+    if (AF_INET6 == addr->raw.family)
+        addr->raw.family = PR_AF_INET6;
 #endif
-        PR_ASSERT(IsValidNetAddr(addr) == PR_TRUE);
-        PR_ASSERT(IsValidNetAddrLen(addr, addr_len) == PR_TRUE);
-        return PR_SUCCESS;
-    }
+    PR_ASSERT(IsValidNetAddr(addr) == PR_TRUE);
+    PR_ASSERT(IsValidNetAddrLen(addr, addr_len) == PR_TRUE);
+    return PR_SUCCESS;
 }  /* pt_GetSockName */
 
 static PRStatus pt_GetPeerName(PRFileDesc *fd, PRNetAddr *addr)
 {
     PRIntn rv = -1;
     pt_SockLen addr_len = sizeof(PRNetAddr);
 
     if (pt_TestAbort()) return PR_FAILURE;
 
     rv = getpeername(
         fd->secret->md.osfd, (struct sockaddr*)addr, &addr_len);
 
     if (rv == -1) {
         pt_MapError(_PR_MD_MAP_GETPEERNAME_ERROR, errno);
         return PR_FAILURE;
-    } else {
+    }
 #ifdef _PR_HAVE_SOCKADDR_LEN
-        /* ignore the sa_len field of struct sockaddr */
-        if (addr)
-        {
-            addr->raw.family = ((struct sockaddr*)addr)->sa_family;
-        }
+    /* ignore the sa_len field of struct sockaddr */
+    if (addr)
+    {
+        addr->raw.family = ((struct sockaddr*)addr)->sa_family;
+    }
 #endif /* _PR_HAVE_SOCKADDR_LEN */
 #ifdef _PR_INET6
-		if (AF_INET6 == addr->raw.family)
-        	addr->raw.family = PR_AF_INET6;
+    if (AF_INET6 == addr->raw.family)
+        addr->raw.family = PR_AF_INET6;
 #endif
-        PR_ASSERT(IsValidNetAddr(addr) == PR_TRUE);
-        PR_ASSERT(IsValidNetAddrLen(addr, addr_len) == PR_TRUE);
-        return PR_SUCCESS;
-    }
+    PR_ASSERT(IsValidNetAddr(addr) == PR_TRUE);
+    PR_ASSERT(IsValidNetAddrLen(addr, addr_len) == PR_TRUE);
+    return PR_SUCCESS;
 }  /* pt_GetPeerName */
 
 static PRStatus pt_GetSocketOption(PRFileDesc *fd, PRSocketOptionData *data)
 {
     PRIntn rv;
     pt_SockLen length;
     PRInt32 level, name;
 
@@ -3708,18 +3706,18 @@ PR_IMPLEMENT(PRStatus) PR_Delete(const c
 
     if (pt_TestAbort()) return PR_FAILURE;
 
     rv = unlink(name);
 
     if (rv == -1) {
         pt_MapError(_PR_MD_MAP_UNLINK_ERROR, errno);
         return PR_FAILURE;
-    } else
-        return PR_SUCCESS;
+    }
+    return PR_SUCCESS;
 }  /* PR_Delete */
 
 PR_IMPLEMENT(PRStatus) PR_Access(const char *name, PRAccessHow how)
 {
     PRIntn rv;
 
     if (pt_TestAbort()) return PR_FAILURE;
 
@@ -3833,21 +3831,20 @@ PR_IMPLEMENT(PRStatus) PR_MkDir(const ch
 PR_IMPLEMENT(PRStatus) PR_RmDir(const char *name)
 {
     PRInt32 rv;
 
     if (pt_TestAbort()) return PR_FAILURE;
 
     rv = rmdir(name);
     if (0 == rv) {
-    return PR_SUCCESS;
-    } else {
+        return PR_SUCCESS;
+    }
     pt_MapError(_PR_MD_MAP_RMDIR_ERROR, errno);
     return PR_FAILURE;
-    }
 }  /* PR_Rmdir */
 
 
 PR_IMPLEMENT(PRDir*) PR_OpenDir(const char *name)
 {
     DIR *osdir;
     PRDir *dir = NULL;
 
--- a/nsprpub/pr/tests/vercheck.c
+++ b/nsprpub/pr/tests/vercheck.c
@@ -34,34 +34,34 @@ static char *compatible_version[] = {
     "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.8", "4.10.9",
-    "4.10.10", "4.11", "4.12", "4.13", "4.14"
+    "4.10.10", "4.11", "4.12", "4.13", "4.14", "4.15"
     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.15.1",
-    "4.16", "4.16.1",
+    "4.16.1",
+    "4.17", "4.17.1",
     "10.0", "11.1", "12.14.20"
 };
 
 int main(int argc, char **argv)
 {
     int idx;
     int num_compatible = sizeof(compatible_version) / sizeof(char *);
     int num_incompatible = sizeof(incompatible_version) / sizeof(char *);