Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
John McEleney
/
mailutils
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit
d880214d
...
d880214df6b0261cf5d1e5d6b980d979f6479a55
authored
2003-10-28 00:57:29 +0000
by
Alain Magloire
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Only call msync() when the file is open with PROT_WRITE
1 parent
e2222e60
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
mailbox/mapfile_stream.c
mailbox/mapfile_stream.c
View file @
d880214
...
...
@@ -187,7 +187,7 @@ _mapfile_size (stream_t stream, off_t *psize)
if
(
mfs
->
ptr
==
MAP_FAILED
)
return
EINVAL
;
if
(
mfs
->
ptr
)
if
(
mfs
->
ptr
&&
(
mfs
->
flags
&
PROT_WRITE
)
)
msync
(
mfs
->
ptr
,
mfs
->
size
,
MS_SYNC
);
if
(
fstat
(
mfs
->
fd
,
&
stbuf
)
!=
0
)
return
errno
;
...
...
@@ -229,7 +229,7 @@ static int
_mapfile_flush
(
stream_t
stream
)
{
struct
_mapfile_stream
*
mfs
=
stream_get_owner
(
stream
);
if
(
mfs
->
ptr
!=
MAP_FAILED
&&
mfs
->
ptr
!=
NULL
)
if
(
mfs
->
ptr
!=
MAP_FAILED
&&
mfs
->
ptr
!=
NULL
&&
(
mfs
->
flags
&
PROT_WRITE
)
)
return
msync
(
mfs
->
ptr
,
mfs
->
size
,
MS_SYNC
);
return
0
;
}
...
...
Please
register
or
sign in
to post a comment