Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
dbfb9b89
Commit
dbfb9b89
authored
Jun 25, 2011
by
Ross Lagerwall
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue 12404: Remove C89 incompatible code from mmap module.
Patch by Akira Kitada.
parent
e697e375
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
1 deletion
+5
-1
Misc/NEWS
Misc/NEWS
+3
-0
Modules/mmapmodule.c
Modules/mmapmodule.c
+2
-1
No files found.
Misc/NEWS
View file @
dbfb9b89
...
...
@@ -25,6 +25,9 @@ Core and Builtins
Library
-------
- Issue #12404: Remove C89 incompatible code from mmap module. Patch by Akira
Kitada.
- Issue #12383: Fix subprocess module with env={}: don't copy the environment
variables, start with an empty environment.
...
...
Modules/mmapmodule.c
View file @
dbfb9b89
...
...
@@ -1140,12 +1140,13 @@ new_mmap_object(PyTypeObject *type, PyObject *args, PyObject *kwdict)
# endif
if
(
fd
!=
-
1
&&
fstat
(
fd
,
&
st
)
==
0
&&
S_ISREG
(
st
.
st_mode
))
{
if
(
map_size
==
0
)
{
off_t
calc_size
;
if
(
offset
>=
st
.
st_size
)
{
PyErr_SetString
(
PyExc_ValueError
,
"mmap offset is greater than file size"
);
return
NULL
;
}
off_t
calc_size
=
st
.
st_size
-
offset
;
calc_size
=
st
.
st_size
-
offset
;
map_size
=
calc_size
;
if
(
map_size
!=
calc_size
)
{
PyErr_SetString
(
PyExc_ValueError
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment