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

Unified Diff: nspr/pr/src/md/unix/unix.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/io/prmmap.c ('k') | nspr/pr/src/md/windows/ntmisc.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: nspr/pr/src/md/unix/unix.c
===================================================================
--- nspr/pr/src/md/unix/unix.c (revision 251855)
+++ nspr/pr/src/md/unix/unix.c (working copy)
@@ -3614,14 +3614,9 @@
{
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 @@
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)
/*
« no previous file with comments | « nspr/pr/src/io/prmmap.c ('k') | nspr/pr/src/md/windows/ntmisc.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698