summaryrefslogtreecommitdiffstats
path: root/chromium/third_party/nss/nspr/pr/src/md/unix/unix.c
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/third_party/nss/nspr/pr/src/md/unix/unix.c')
-rw-r--r--chromium/third_party/nss/nspr/pr/src/md/unix/unix.c23
1 files changed, 16 insertions, 7 deletions
diff --git a/chromium/third_party/nss/nspr/pr/src/md/unix/unix.c b/chromium/third_party/nss/nspr/pr/src/md/unix/unix.c
index 02962e6737a..38f7be9b3ef 100644
--- a/chromium/third_party/nss/nspr/pr/src/md/unix/unix.c
+++ b/chromium/third_party/nss/nspr/pr/src/md/unix/unix.c
@@ -3614,14 +3614,9 @@ PRStatus _MD_MemUnmap(void *addr, PRUint32 len)
{
if (munmap(addr, len) == 0) {
return PR_SUCCESS;
- } else {
- if (errno == EINVAL) {
- PR_SetError(PR_INVALID_ARGUMENT_ERROR, errno);
- } else {
- PR_SetError(PR_UNKNOWN_ERROR, errno);
- }
- return PR_FAILURE;
}
+ _PR_MD_MAP_DEFAULT_ERROR(errno);
+ return PR_FAILURE;
}
PRStatus _MD_CloseFileMap(PRFileMap *fmap)
@@ -3638,6 +3633,20 @@ PRStatus _MD_CloseFileMap(PRFileMap *fmap)
return PR_SUCCESS;
}
+PRStatus _MD_SyncMemMap(
+ PRFileDesc *fd,
+ void *addr,
+ PRUint32 len)
+{
+ /* msync(..., MS_SYNC) alone is sufficient to flush modified data to disk
+ * synchronously. It is not necessary to call fsync. */
+ if (msync(addr, len, MS_SYNC) == 0) {
+ return PR_SUCCESS;
+ }
+ _PR_MD_MAP_DEFAULT_ERROR(errno);
+ return PR_FAILURE;
+}
+
#if defined(_PR_NEED_FAKE_POLL)
/*