Hello community, here is the log from the commit of package mozilla-nspr for openSUSE:Factory checked in at 2017-09-25 13:55:00 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/mozilla-nspr (Old) and /work/SRC/openSUSE:Factory/.mozilla-nspr.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "mozilla-nspr" Mon Sep 25 13:55:00 2017 rev:64 rq:528035 version:4.16 Changes: -------- --- /work/SRC/openSUSE:Factory/mozilla-nspr/mozilla-nspr.changes 2017-08-17 11:46:57.413713139 +0200 +++ /work/SRC/openSUSE:Factory/.mozilla-nspr.new/mozilla-nspr.changes 2017-09-25 13:55:02.103821347 +0200 @@ -1,0 +2,9 @@ +Tue Sep 12 09:01:01 UTC 2017 - w...@rosenauer.org + +- update to version 4.16 + * contains various correctness fixes + see + https://bugzilla.mozilla.org/buglist.cgi?resolution=FIXED&query_format=advanced&product=NSPR&target_milestone=4.16 + for details + +------------------------------------------------------------------- Old: ---- nspr-4.15.tar.gz New: ---- nspr-4.16.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ mozilla-nspr.spec ++++++ --- /var/tmp/diff_new_pack.DkJYNk/_old 2017-09-25 13:55:03.615608643 +0200 +++ /var/tmp/diff_new_pack.DkJYNk/_new 2017-09-25 13:55:03.619608081 +0200 @@ -18,7 +18,7 @@ Name: mozilla-nspr -Version: 4.15 +Version: 4.16 Release: 0 Summary: Netscape Portable Runtime License: MPL-2.0 ++++++ nspr-4.15.tar.gz -> nspr-4.16.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nspr-4.15/nspr/.hg_archival.txt new/nspr-4.16/nspr/.hg_archival.txt --- old/nspr-4.15/nspr/.hg_archival.txt 2017-06-05 22:16:00.000000000 +0200 +++ new/nspr-4.16/nspr/.hg_archival.txt 2017-07-27 14:31:27.000000000 +0200 @@ -1,4 +1,4 @@ repo: a4b34919bf34db2ee22acbbc305693c8980b6dc6 -node: cedc5c8d44fbdfbb1d1616d3752fb6bf33705d6a +node: fa3dad3d8099d71ea6d9fe489afb63cb18894f0c branch: default -tag: NSPR_4_15_RTM +tag: NSPR_4_16_RTM diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nspr-4.15/nspr/configure new/nspr-4.16/nspr/configure --- old/nspr-4.15/nspr/configure 2017-06-05 22:16:00.000000000 +0200 +++ new/nspr-4.16/nspr/configure 2017-07-27 14:31:27.000000000 +0200 @@ -2488,7 +2488,7 @@ 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= @@ -6714,6 +6714,8 @@ $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 @@ -7324,6 +7326,8 @@ $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 @@ -7380,6 +7384,8 @@ $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 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nspr-4.15/nspr/configure.in new/nspr-4.16/nspr/configure.in --- old/nspr-4.15/nspr/configure.in 2017-06-05 22:16:00.000000000 +0200 +++ new/nspr-4.16/nspr/configure.in 2017-07-27 14:31:27.000000000 +0200 @@ -15,7 +15,7 @@ dnl = Defaults dnl ======================================================== MOD_MAJOR_VERSION=4 -MOD_MINOR_VERSION=15 +MOD_MINOR_VERSION=16 MOD_PATCH_VERSION=0 NSPR_MODNAME=nspr20 _HAVE_PTHREADS= @@ -1389,6 +1389,7 @@ 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 @@ -1559,6 +1560,7 @@ 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 @@ -2119,6 +2121,7 @@ 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 @@ -2167,6 +2170,7 @@ 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 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nspr-4.15/nspr/pr/include/md/_linux.cfg new/nspr-4.16/nspr/pr/include/md/_linux.cfg --- old/nspr-4.15/nspr/pr/include/md/_linux.cfg 2017-06-05 22:16:00.000000000 +0200 +++ new/nspr-4.16/nspr/pr/include/md/_linux.cfg 2017-07-27 14:31:27.000000000 +0200 @@ -498,6 +498,9 @@ #elif defined(__mips__) +/* For _ABI64 */ +#include <sgidefs.h> + #ifdef __MIPSEB__ #define IS_BIG_ENDIAN 1 #undef IS_LITTLE_ENDIAN diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nspr-4.15/nspr/pr/include/prinit.h new/nspr-4.16/nspr/pr/include/prinit.h --- old/nspr-4.15/nspr/pr/include/prinit.h 2017-06-05 22:16:00.000000000 +0200 +++ new/nspr-4.16/nspr/pr/include/prinit.h 2017-07-27 14:31:27.000000000 +0200 @@ -31,9 +31,9 @@ ** The format of the version string is ** "<major version>.<minor version>[.<patch level>] [<Beta>]" */ -#define PR_VERSION "4.15" +#define PR_VERSION "4.16" #define PR_VMAJOR 4 -#define PR_VMINOR 15 +#define PR_VMINOR 16 #define PR_VPATCH 0 #define PR_BETA PR_FALSE diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nspr-4.15/nspr/pr/include/prtypes.h new/nspr-4.16/nspr/pr/include/prtypes.h --- old/nspr-4.15/nspr/pr/include/prtypes.h 2017-06-05 22:16:00.000000000 +0200 +++ new/nspr-4.16/nspr/pr/include/prtypes.h 2017-07-27 14:31:27.000000000 +0200 @@ -245,16 +245,24 @@ #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; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nspr-4.15/nspr/pr/src/io/prlayer.c new/nspr-4.16/nspr/pr/src/io/prlayer.c --- old/nspr-4.15/nspr/pr/src/io/prlayer.c 2017-06-05 22:16:00.000000000 +0200 +++ new/nspr-4.16/nspr/pr/src/io/prlayer.c 2017-07-27 14:31:27.000000000 +0200 @@ -47,7 +47,8 @@ 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 */ @@ -201,16 +202,16 @@ 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) @@ -326,12 +327,11 @@ (*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 ( @@ -494,10 +494,9 @@ { 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( @@ -704,8 +703,8 @@ 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) @@ -713,10 +712,10 @@ 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) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nspr-4.15/nspr/pr/src/io/prmmap.c new/nspr-4.16/nspr/pr/src/io/prmmap.c --- old/nspr-4.15/nspr/pr/src/io/prmmap.c 2017-06-05 22:16:00.000000000 +0200 +++ new/nspr-4.16/nspr/pr/src/io/prmmap.c 2017-07-27 14:31:27.000000000 +0200 @@ -24,17 +24,16 @@ || 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) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nspr-4.15/nspr/pr/src/io/prscanf.c new/nspr-4.16/nspr/pr/src/io/prscanf.c --- old/nspr-4.15/nspr/pr/src/io/prscanf.c 2017-06-05 22:16:00.000000000 +0200 +++ new/nspr-4.16/nspr/pr/src/io/prscanf.c 2017-07-27 14:31:27.000000000 +0200 @@ -409,7 +409,8 @@ ch = GET(state); if (ch == EOF) { return NULL; - } else if (state->assign) { + } + if (state->assign) { *cArg++ = ch; } } @@ -602,10 +603,9 @@ if (*cPtr == '\0') { return EOF; - } else { - *((char **) stream) = cPtr + 1; - return (unsigned char) *cPtr; } + *((char **) stream) = cPtr + 1; + return (unsigned char) *cPtr; } static void diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nspr-4.15/nspr/pr/src/io/prsocket.c new/nspr-4.16/nspr/pr/src/io/prsocket.c --- old/nspr-4.15/nspr/pr/src/io/prsocket.c 2017-06-05 22:16:00.000000000 +0200 +++ new/nspr-4.16/nspr/pr/src/io/prsocket.c 2017-07-27 14:31:27.000000000 +0200 @@ -322,7 +322,7 @@ PR_ASSERT(fd->secret->nonblocking); PRInt32 rvSent; if (GetOverlappedResult(osfd, &fd->secret->ol, &rvSent, FALSE) == TRUE) { - fd->secret->overlappedActive = FALSE; + fd->secret->overlappedActive = PR_FALSE; PR_LOG(_pr_io_lm, PR_LOG_MIN, ("SocketConnectContinue GetOverlappedResult succeeded\n")); /* When ConnectEx is used, all previously set socket options and @@ -340,9 +340,9 @@ 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; + fd->secret->overlappedActive = PR_FALSE; return PR_FAILURE; } else { PR_SetError(PR_IN_PROGRESS_ERROR, 0); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nspr-4.15/nspr/pr/src/md/unix/unix.c new/nspr-4.16/nspr/pr/src/md/unix/unix.c --- old/nspr-4.15/nspr/pr/src/md/unix/unix.c 2017-06-05 22:16:00.000000000 +0200 +++ new/nspr-4.16/nspr/pr/src/md/unix/unix.c 2017-07-27 14:31:27.000000000 +0200 @@ -3316,11 +3316,11 @@ return errno; } else { return err; - } + } } } else { return ECONNREFUSED; - } + } #elif defined(UNIXWARE) /* * getsockopt() fails with EPIPE, so use getmsg() instead. @@ -3331,17 +3331,17 @@ 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 } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nspr-4.15/nspr/pr/src/md/unix/uxproces.c new/nspr-4.16/nspr/pr/src/md/unix/uxproces.c --- old/nspr-4.15/nspr/pr/src/md/unix/uxproces.c 2017-06-05 22:16:00.000000000 +0200 +++ new/nspr-4.16/nspr/pr/src/md/unix/uxproces.c 2017-07-27 14:31:27.000000000 +0200 @@ -247,13 +247,14 @@ 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) { @@ -498,10 +499,9 @@ #endif if (WIFEXITED(rawExitStatus)) { return WEXITSTATUS(rawExitStatus); - } else { + } PR_ASSERT(WIFSIGNALED(rawExitStatus)); return _PR_SIGNALED_EXITSTATUS; - } } static void @@ -624,8 +624,8 @@ } 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) { @@ -639,8 +639,8 @@ } op->done = PR_TRUE; PR_NotifyCondVar(op->doneCV); - PR_Unlock(pr_wp.ml); } + PR_Unlock(pr_wp.ml); #endif while (1) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nspr-4.15/nspr/pr/src/md/unix/uxshm.c new/nspr-4.16/nspr/pr/src/md/unix/uxshm.c --- old/nspr-4.15/nspr/pr/src/md/unix/uxshm.c 2017-06-05 22:16:00.000000000 +0200 +++ new/nspr-4.16/nspr/pr/src/md/unix/uxshm.c 2017-07-27 14:31:27.000000000 +0200 @@ -76,8 +76,8 @@ /* 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; @@ -500,30 +500,32 @@ ("_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 ); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nspr-4.15/nspr/pr/src/md/windows/w95sock.c new/nspr-4.16/nspr/pr/src/md/windows/w95sock.c --- old/nspr-4.15/nspr/pr/src/md/windows/w95sock.c 2017-06-05 22:16:00.000000000 +0200 +++ new/nspr-4.16/nspr/pr/src/md/windows/w95sock.c 2017-07-27 14:31:27.000000000 +0200 @@ -333,7 +333,8 @@ #if defined(_WIN64) static PRCallOnceType _pr_has_connectex_once; -typedef BOOL (WINAPI *_pr_win_connectex_ptr)(SOCKET, const struct sockaddr *, int, PVOID, DWORD, LPDWORD, LPOVERLAPPED); +typedef BOOL (PASCAL FAR * _pr_win_connectex_ptr)(_In_ SOCKET s, _In_reads_bytes_(namelen) const struct sockaddr FAR *name, _In_ int namelen, _In_reads_bytes_opt_(dwSendDataLength) PVOID lpSendBuffer, _In_ DWORD dwSendDataLength, _Out_ LPDWORD lpdwBytesSent, _Inout_ LPOVERLAPPED lpOverlapped); + #ifndef WSAID_CONNECTEX #define WSAID_CONNECTEX \ {0x25a207b9,0xddf3,0x4660,{0x8e,0xe9,0x76,0xe5,0x8c,0x74,0x06,0x3e}} @@ -349,7 +350,7 @@ #define SO_UPDATE_CONNECT_CONTEXT 0x7010 #endif -static _pr_win_connectex_ptr _pr_win_connectex; +static _pr_win_connectex_ptr _pr_win_connectex = NULL; static PRStatus PR_CALLBACK _pr_set_connectex(void) { @@ -413,12 +414,9 @@ /* 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, @@ -461,16 +459,24 @@ _PR_MD_MAP_CONNECT_ERROR(err); return -1; } else if (fd->secret->nonblocking) { - /* Remember that overlapped structure is set. We will neede to get + /* Remember that overlapped structure is set. We will need to get * 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; + if (amount > 0) { + return amount; + } + + _PR_MD_MAP_CONNECT_ERROR(WSAEWOULDBLOCK); + return -1; } - 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; @@ -480,7 +486,7 @@ return rvSent; } else { err = WSAGetLastError(); - if (err != ERROR_IO_PENDING) { + if (err != ERROR_IO_INCOMPLETE) { _PR_MD_MAP_CONNECT_ERROR(err); return -1; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nspr-4.15/nspr/pr/src/misc/prnetdb.c new/nspr-4.16/nspr/pr/src/misc/prnetdb.c --- old/nspr-4.15/nspr/pr/src/misc/prnetdb.c 2017-06-05 22:16:00.000000000 +0200 +++ new/nspr-4.16/nspr/pr/src/misc/prnetdb.c 2017-07-27 14:31:27.000000000 +0200 @@ -1483,18 +1483,20 @@ 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)) { @@ -1504,8 +1506,9 @@ 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; } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nspr-4.15/nspr/pr/src/misc/prtime.c new/nspr-4.16/nspr/pr/src/misc/prtime.c --- old/nspr-4.15/nspr/pr/src/misc/prtime.c 2017-06-05 22:16:00.000000000 +0200 +++ new/nspr-4.16/nspr/pr/src/misc/prtime.c 2017-07-27 14:31:27.000000000 +0200 @@ -279,8 +279,7 @@ { if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0) return 1; - else - return 0; + return 0; } /* @@ -1236,7 +1235,7 @@ 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 @@ -1251,12 +1250,12 @@ 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'); @@ -1274,7 +1273,7 @@ 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 @@ -1308,7 +1307,7 @@ 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 @@ -2014,24 +2013,22 @@ dayOfWeek = time->tm_wday - firstDayOfWeek; if (dayOfWeek < 0) dayOfWeek += 7; - - dayOfYear = time->tm_yday - dayOfWeek; + 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 ); + } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nspr-4.15/nspr/pr/src/misc/prtpool.c new/nspr-4.16/nspr/pr/src/misc/prtpool.c --- old/nspr-4.15/nspr/pr/src/misc/prtpool.c 2017-06-05 22:16:00.000000000 +0200 +++ new/nspr-4.16/nspr/pr/src/misc/prtpool.c 2017-07-27 14:31:27.000000000 +0200 @@ -862,16 +862,16 @@ 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 */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nspr-4.15/nspr/pr/src/pthreads/ptio.c new/nspr-4.16/nspr/pr/src/pthreads/ptio.c --- old/nspr-4.15/nspr/pr/src/pthreads/ptio.c 2017-06-05 22:16:00.000000000 +0200 +++ new/nspr-4.16/nspr/pr/src/pthreads/ptio.c 2017-07-27 14:31:27.000000000 +0200 @@ -824,7 +824,7 @@ 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; @@ -853,7 +853,7 @@ 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; @@ -895,7 +895,7 @@ 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; @@ -918,7 +918,7 @@ 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; @@ -2874,22 +2874,21 @@ 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) @@ -2905,22 +2904,21 @@ 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) @@ -3713,8 +3711,8 @@ 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) @@ -3838,11 +3836,10 @@ 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 */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nspr-4.15/nspr/pr/src/pthreads/ptsynch.c new/nspr-4.16/nspr/pr/src/pthreads/ptsynch.c --- old/nspr-4.15/nspr/pr/src/pthreads/ptsynch.c 2017-06-05 22:16:00.000000000 +0200 +++ new/nspr-4.16/nspr/pr/src/pthreads/ptsynch.c 2017-07-27 14:31:27.000000000 +0200 @@ -55,12 +55,11 @@ rv = _PT_PTHREAD_MUTEXATTR_INIT(&_pt_mattr); PR_ASSERT(0 == rv); -#ifdef LINUX -#if (__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2) +#if (defined(LINUX) && (__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2)) || \ + (defined(FREEBSD) && __FreeBSD_version > 700055) rv = pthread_mutexattr_settype(&_pt_mattr, PTHREAD_MUTEX_ADAPTIVE_NP); PR_ASSERT(0 == rv); #endif -#endif rv = _PT_PTHREAD_CONDATTR_INIT(&_pt_cvar_attr); PR_ASSERT(0 == rv); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nspr-4.15/nspr/pr/tests/accept.c new/nspr-4.16/nspr/pr/tests/accept.c --- old/nspr-4.15/nspr/pr/tests/accept.c 2017-06-05 22:16:00.000000000 +0200 +++ new/nspr-4.16/nspr/pr/tests/accept.c 2017-07-27 14:31:27.000000000 +0200 @@ -143,12 +143,13 @@ if (action != CLIENT_TIMEOUT_SEND) { if ((rv = PR_Send(sock, buf, CLIENT_DATA, 0, timeoutTime))< 0) { - if (!debug_mode) + if (!debug_mode) { failed_already=1; - else - PR_fprintf(output, + } else { + PR_fprintf(output, "client: unable to send to server (%d, %ld, %ld)\n", CLIENT_DATA, rv, PR_GetError()); + } goto ErrorExit; } } else { @@ -200,8 +201,9 @@ continue; } failed_already=1; - if (debug_mode) + if (debug_mode) { PR_fprintf(output,"accept: ERROR - PR_Bind failed\n"); + } return; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nspr-4.15/nspr/pr/tests/alarm.c new/nspr-4.16/nspr/pr/tests/alarm.c --- old/nspr-4.15/nspr/pr/tests/alarm.c 2017-06-05 22:16:00.000000000 +0200 +++ new/nspr-4.16/nspr/pr/tests/alarm.c 2017-07-27 14:31:27.000000000 +0200 @@ -411,15 +411,15 @@ PRUint32 overhead, usecs; PRIntervalTime predicted, timein, timeout, ticks; - if (debug_mode) - printf("Testing %s ...", msg); + if (debug_mode) + printf("Testing %s ...", msg); timein = PR_IntervalNow(); predicted = func(loops); timeout = PR_IntervalNow(); - if (debug_mode) - printf(" done\n"); + if (debug_mode) + printf(" done\n"); ticks = timeout - timein; usecs = PR_IntervalToMicroseconds(ticks); @@ -491,17 +491,17 @@ for (cpu = 1; cpu <= cpus; ++cpu) { - if (debug_mode) + if (debug_mode) printf("\nAlarm: Using %d CPU(s)\n", cpu); - PR_SetConcurrency(cpu); - - /* some basic time test */ - (void)TimeThis("ConditionNotify", ConditionNotify, loops); - (void)TimeThis("ConditionTimeout", ConditionTimeout, loops); - (void)TimeThis("Alarms1", Alarms1, loops); - (void)TimeThis("Alarms2", Alarms2, loops); - (void)TimeThis("Alarms3", Alarms3, loops); + PR_SetConcurrency(cpu); + + /* some basic time test */ + (void)TimeThis("ConditionNotify", ConditionNotify, loops); + (void)TimeThis("ConditionTimeout", ConditionTimeout, loops); + (void)TimeThis("Alarms1", Alarms1, loops); + (void)TimeThis("Alarms2", Alarms2, loops); + (void)TimeThis("Alarms3", Alarms3, loops); } return 0; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nspr-4.15/nspr/pr/tests/vercheck.c new/nspr-4.16/nspr/pr/tests/vercheck.c --- old/nspr-4.15/nspr/pr/tests/vercheck.c 2017-06-05 22:16:00.000000000 +0200 +++ new/nspr-4.16/nspr/pr/tests/vercheck.c 2017-07-27 14:31:27.000000000 +0200 @@ -39,7 +39,7 @@ "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 }; @@ -55,8 +55,8 @@ "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" };