summaryrefslogtreecommitdiff
path: root/nsprpub/pr/src/md
diff options
context:
space:
mode:
authorMoonchild <moonchild@palemoon.org>2020-12-23 19:01:09 +0000
committerMoonchild <moonchild@palemoon.org>2020-12-23 19:01:09 +0000
commit149d2ffa779826cb48a381099858e76e4624d471 (patch)
tree1adb922c55da8094039ea14f4b2178314d51f2a1 /nsprpub/pr/src/md
parent25b6703e956a33e0ecd8bdc18f423e5eb5dd09d4 (diff)
downloaduxp-149d2ffa779826cb48a381099858e76e4624d471.tar.gz
Issue #1693 - Update NSPR to 4.29
Diffstat (limited to 'nsprpub/pr/src/md')
-rw-r--r--nsprpub/pr/src/md/unix/os_Linux_ia64.s2
-rw-r--r--nsprpub/pr/src/md/unix/os_Linux_ppc.s2
-rw-r--r--nsprpub/pr/src/md/unix/os_Linux_x86.s2
-rw-r--r--nsprpub/pr/src/md/unix/os_Linux_x86_64.s2
-rw-r--r--nsprpub/pr/src/md/unix/unix.c6
-rw-r--r--nsprpub/pr/src/md/windows/ntio.c10
-rw-r--r--nsprpub/pr/src/md/windows/ntmisc.c24
-rw-r--r--nsprpub/pr/src/md/windows/w95sock.c3
8 files changed, 42 insertions, 9 deletions
diff --git a/nsprpub/pr/src/md/unix/os_Linux_ia64.s b/nsprpub/pr/src/md/unix/os_Linux_ia64.s
index fef24ad109..39b724ae47 100644
--- a/nsprpub/pr/src/md/unix/os_Linux_ia64.s
+++ b/nsprpub/pr/src/md/unix/os_Linux_ia64.s
@@ -68,4 +68,4 @@ _PR_ia64_AtomicSet:
.endp _PR_ia64_AtomicSet#
// Magic indicating no need for an executable stack
-.section .note.GNU-stack, "", @progbits ; .previous
+.section .note.GNU-stack, "", @progbits
diff --git a/nsprpub/pr/src/md/unix/os_Linux_ppc.s b/nsprpub/pr/src/md/unix/os_Linux_ppc.s
index a9a83174a7..76da33bffc 100644
--- a/nsprpub/pr/src/md/unix/os_Linux_ppc.s
+++ b/nsprpub/pr/src/md/unix/os_Linux_ppc.s
@@ -72,4 +72,4 @@ _PR_ppc_AtomicAdd:
.Lfe4: .size _PR_ppc_AtomicAdd,.Lfe4-_PR_ppc_AtomicAdd
# Magic indicating no need for an executable stack
-.section .note.GNU-stack, "", @progbits ; .previous
+.section .note.GNU-stack, "", @progbits
diff --git a/nsprpub/pr/src/md/unix/os_Linux_x86.s b/nsprpub/pr/src/md/unix/os_Linux_x86.s
index a72acf5d70..83e10b4552 100644
--- a/nsprpub/pr/src/md/unix/os_Linux_x86.s
+++ b/nsprpub/pr/src/md/unix/os_Linux_x86.s
@@ -82,4 +82,4 @@ _PR_x86_AtomicAdd:
ret
// Magic indicating no need for an executable stack
-.section .note.GNU-stack, "", @progbits ; .previous
+.section .note.GNU-stack, "", @progbits
diff --git a/nsprpub/pr/src/md/unix/os_Linux_x86_64.s b/nsprpub/pr/src/md/unix/os_Linux_x86_64.s
index 8e491f0e6d..f30e75d538 100644
--- a/nsprpub/pr/src/md/unix/os_Linux_x86_64.s
+++ b/nsprpub/pr/src/md/unix/os_Linux_x86_64.s
@@ -71,4 +71,4 @@ _PR_x86_64_AtomicAdd:
.size _PR_x86_64_AtomicAdd, .-_PR_x86_64_AtomicAdd
// Magic indicating no need for an executable stack
-.section .note.GNU-stack, "", @progbits ; .previous
+.section .note.GNU-stack, "", @progbits
diff --git a/nsprpub/pr/src/md/unix/unix.c b/nsprpub/pr/src/md/unix/unix.c
index a8862a4ce5..56b58aa726 100644
--- a/nsprpub/pr/src/md/unix/unix.c
+++ b/nsprpub/pr/src/md/unix/unix.c
@@ -3481,7 +3481,8 @@ PRStatus _MD_getsysinfo(PRSysInfo cmd, char *name, PRUint32 namelen)
{
struct utsname info;
- PR_ASSERT((cmd == PR_SI_SYSNAME) || (cmd == PR_SI_RELEASE));
+ PR_ASSERT((cmd == PR_SI_SYSNAME) || (cmd == PR_SI_RELEASE) ||
+ (cmd == PR_SI_RELEASE_BUILD));
if (uname(&info) == -1) {
_PR_MD_MAP_DEFAULT_ERROR(errno);
@@ -3493,6 +3494,9 @@ PRStatus _MD_getsysinfo(PRSysInfo cmd, char *name, PRUint32 namelen)
else if (PR_SI_RELEASE == cmd) {
(void)PR_snprintf(name, namelen, info.release);
}
+ else if (PR_SI_RELEASE_BUILD == cmd) {
+ (void)PR_snprintf(name, namelen, info.version);
+ }
else {
return PR_FAILURE;
}
diff --git a/nsprpub/pr/src/md/windows/ntio.c b/nsprpub/pr/src/md/windows/ntio.c
index 040bbd3106..40f5200789 100644
--- a/nsprpub/pr/src/md/windows/ntio.c
+++ b/nsprpub/pr/src/md/windows/ntio.c
@@ -2252,6 +2252,7 @@ _PR_MD_READ(PRFileDesc *fd, void *buf, PRInt32 len)
int rv, err;
LONG hiOffset = 0;
LONG loOffset;
+ LARGE_INTEGER offset; /* use for a normalized add of len to offset */
if (!fd->secret->md.sync_file_io) {
PRThread *me = _PR_MD_CURRENT_THREAD();
@@ -2368,7 +2369,14 @@ _PR_MD_READ(PRFileDesc *fd, void *buf, PRInt32 len)
return -1;
}
- SetFilePointer((HANDLE)f, me->md.blocked_io_bytes, 0, FILE_CURRENT);
+ /* Apply the workaround from bug 70765 (see _PR_MD_WRITE)
+ * to the reading code, too. */
+
+ offset.LowPart = me->md.overlapped.overlapped.Offset;
+ offset.HighPart = me->md.overlapped.overlapped.OffsetHigh;
+ offset.QuadPart += me->md.blocked_io_bytes;
+
+ SetFilePointer((HANDLE)f, offset.LowPart, &offset.HighPart, FILE_BEGIN);
PR_ASSERT(me->io_pending == PR_FALSE);
diff --git a/nsprpub/pr/src/md/windows/ntmisc.c b/nsprpub/pr/src/md/windows/ntmisc.c
index 1ec6c2a5e5..839e3de8d8 100644
--- a/nsprpub/pr/src/md/windows/ntmisc.c
+++ b/nsprpub/pr/src/md/windows/ntmisc.c
@@ -812,7 +812,8 @@ PRStatus _MD_WindowsGetSysInfo(PRSysInfo cmd, char *name, PRUint32 namelen)
{
OSVERSIONINFO osvi;
- PR_ASSERT((cmd == PR_SI_SYSNAME) || (cmd == PR_SI_RELEASE));
+ PR_ASSERT((cmd == PR_SI_SYSNAME) || (cmd == PR_SI_RELEASE) ||
+ (cmd == PR_SI_RELEASE_BUILD));
ZeroMemory(&osvi, sizeof(OSVERSIONINFO));
osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
@@ -827,9 +828,13 @@ PRStatus _MD_WindowsGetSysInfo(PRSysInfo cmd, char *name, PRUint32 namelen)
if (PR_SI_SYSNAME == cmd) {
(void)PR_snprintf(name, namelen, "Windows_NT");
}
- else if (PR_SI_RELEASE == cmd)
+ else if (PR_SI_RELEASE == cmd) {
(void)PR_snprintf(name, namelen, "%d.%d",osvi.dwMajorVersion,
osvi.dwMinorVersion);
+ }
+ else if (PR_SI_RELEASE_BUILD == cmd) {
+ (void)PR_snprintf(name, namelen, "%d", osvi.dwBuildNumber);
+ }
break;
case VER_PLATFORM_WIN32_WINDOWS:
if (PR_SI_SYSNAME == cmd) {
@@ -843,6 +848,8 @@ PRStatus _MD_WindowsGetSysInfo(PRSysInfo cmd, char *name, PRUint32 namelen)
} else if (PR_SI_RELEASE == cmd) {
(void)PR_snprintf(name, namelen, "%d.%d",osvi.dwMajorVersion,
osvi.dwMinorVersion);
+ } else if (PR_SI_RELEASE_BUILD == cmd) {
+ (void)PR_snprintf(name, namelen, "%d", osvi.dwBuildNumber);
}
break;
#ifdef VER_PLATFORM_WIN32_CE
@@ -850,9 +857,15 @@ PRStatus _MD_WindowsGetSysInfo(PRSysInfo cmd, char *name, PRUint32 namelen)
if (PR_SI_SYSNAME == cmd) {
(void)PR_snprintf(name, namelen, "Windows_CE");
}
- else if (PR_SI_RELEASE == cmd)
+ else if (PR_SI_RELEASE == cmd) {
(void)PR_snprintf(name, namelen, "%d.%d",osvi.dwMajorVersion,
osvi.dwMinorVersion);
+ }
+ else if (PR_SI_RELEASE_BUILD == cmd) {
+ if (namelen) {
+ *name = 0;
+ }
+ }
break;
#endif
default:
@@ -862,6 +875,11 @@ PRStatus _MD_WindowsGetSysInfo(PRSysInfo cmd, char *name, PRUint32 namelen)
else if (PR_SI_RELEASE == cmd) {
(void)PR_snprintf(name, namelen, "%d.%d",0,0);
}
+ else if (PR_SI_RELEASE_BUILD == cmd) {
+ if (namelen) {
+ *name = 0;
+ }
+ }
break;
}
return PR_SUCCESS;
diff --git a/nsprpub/pr/src/md/windows/w95sock.c b/nsprpub/pr/src/md/windows/w95sock.c
index 7d7362c608..5aff369be4 100644
--- a/nsprpub/pr/src/md/windows/w95sock.c
+++ b/nsprpub/pr/src/md/windows/w95sock.c
@@ -7,6 +7,9 @@
*
*/
+#if defined(_WIN64)
+#include <winsock2.h>
+#endif
#include "primpl.h"
#define READ_FD 1