[Python-checkins] cpython: Issue #23668: Suppresses invalid parameter handler around chsize calls.
steve.dower
python-checkins at python.org
Sun Apr 12 06:32:32 CEST 2015
https://hg.python.org/cpython/rev/eba85ae7d128
changeset: 95553:eba85ae7d128
user: Steve Dower <steve.dower at microsoft.com>
date: Sun Apr 12 00:26:43 2015 -0400
summary:
Issue #23668: Suppresses invalid parameter handler around chsize calls.
files:
Modules/_io/fileio.c | 2 ++
Modules/posixmodule.c | 4 ++++
2 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/Modules/_io/fileio.c b/Modules/_io/fileio.c
--- a/Modules/_io/fileio.c
+++ b/Modules/_io/fileio.c
@@ -880,12 +880,14 @@
}
Py_BEGIN_ALLOW_THREADS
+ _Py_BEGIN_SUPPRESS_IPH
errno = 0;
#ifdef MS_WINDOWS
ret = _chsize_s(fd, pos);
#else
ret = ftruncate(fd, pos);
#endif
+ _Py_END_SUPPRESS_IPH
Py_END_ALLOW_THREADS
if (ret != 0) {
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c
--- a/Modules/posixmodule.c
+++ b/Modules/posixmodule.c
@@ -8803,11 +8803,13 @@
do {
Py_BEGIN_ALLOW_THREADS
+ _Py_BEGIN_SUPPRESS_IPH
#ifdef MS_WINDOWS
result = _chsize_s(fd, length);
#else
result = ftruncate(fd, length);
#endif
+ _Py_END_SUPPRESS_IPH
Py_END_ALLOW_THREADS
} while (result != 0 && errno == EINTR &&
!(async_err = PyErr_CheckSignals()));
@@ -8843,6 +8845,7 @@
return os_ftruncate_impl(module, path->fd, length);
Py_BEGIN_ALLOW_THREADS
+ _Py_BEGIN_SUPPRESS_IPH
#ifdef MS_WINDOWS
if (path->wide)
fd = _wopen(path->wide, _O_WRONLY | _O_BINARY | _O_NOINHERIT);
@@ -8859,6 +8862,7 @@
#else
result = truncate(path->narrow, length);
#endif
+ _Py_END_SUPPRESS_IPH
Py_END_ALLOW_THREADS
if (result < 0)
return path_error(path);
--
Repository URL: https://hg.python.org/cpython
More information about the Python-checkins
mailing list