Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1180)

Unified Diff: nspr/pr/src/md/windows/ntmisc.c

Issue 170823003: Update to NSS 3.15.5 and NSPR 4.10.3. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/deps/third_party/nss/
Patch Set: Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « nspr/pr/src/md/unix/unix.c ('k') | nspr/pr/src/pthreads/ptio.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: nspr/pr/src/md/windows/ntmisc.c
===================================================================
--- nspr/pr/src/md/windows/ntmisc.c (revision 251855)
+++ nspr/pr/src/md/windows/ntmisc.c (working copy)
@@ -982,10 +982,9 @@
{
if (UnmapViewOfFile(addr)) {
return PR_SUCCESS;
- } else {
- PR_SetError(PR_UNKNOWN_ERROR, GetLastError());
- return PR_FAILURE;
}
+ _PR_MD_MAP_DEFAULT_ERROR(GetLastError());
+ return PR_FAILURE;
}
PRStatus _MD_CloseFileMap(PRFileMap *fmap)
@@ -995,6 +994,25 @@
return PR_SUCCESS;
}
+PRStatus _MD_SyncMemMap(
+ PRFileDesc *fd,
+ void *addr,
+ PRUint32 len)
+{
+ PROsfd osfd = fd->secret->md.osfd;
+
+ /* The FlushViewOfFile page on MSDN says:
+ * To flush all the dirty pages plus the metadata for the file and
+ * ensure that they are physically written to disk, call
+ * FlushViewOfFile and then call the FlushFileBuffers function.
+ */
+ if (FlushViewOfFile(addr, len) && FlushFileBuffers((HANDLE) osfd)) {
+ return PR_SUCCESS;
+ }
+ _PR_MD_MAP_DEFAULT_ERROR(GetLastError());
+ return PR_FAILURE;
+}
+
/*
***********************************************************************
*
« no previous file with comments | « nspr/pr/src/md/unix/unix.c ('k') | nspr/pr/src/pthreads/ptio.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698