summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorRoss Lagerwall <rosslagerwall@gmail.com>2011-06-25 07:55:10 (GMT)
committerRoss Lagerwall <rosslagerwall@gmail.com>2011-06-25 07:55:10 (GMT)
commitffa8e2fb5637db784478e0f1f3c0d260dbae972e (patch)
treeb4aba5b7ffe6cd26a69a4b0d5a083d888cc4fc12 /Modules
parent17e2b40aae9bcc5d55da6a1d96b439684fa68a40 (diff)
downloadcpython-ffa8e2fb5637db784478e0f1f3c0d260dbae972e.zip
cpython-ffa8e2fb5637db784478e0f1f3c0d260dbae972e.tar.gz
cpython-ffa8e2fb5637db784478e0f1f3c0d260dbae972e.tar.bz2
Issue 12404: Remove C89 incompatible code from mmap module.
Patch by Akira Kitada.
Diffstat (limited to 'Modules')
-rw-r--r--Modules/mmapmodule.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/Modules/mmapmodule.c b/Modules/mmapmodule.c
index 3078279..a5027f5 100644
--- a/Modules/mmapmodule.c
+++ b/Modules/mmapmodule.c
@@ -1188,12 +1188,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,