cpython: eba85ae7d128 (original) (raw)
Mercurial > cpython
changeset 95553:eba85ae7d128
Issue #23668: Suppresses invalid parameter handler around chsize calls. [#23668]
Steve Dower steve.dower@microsoft.com | |
---|---|
date | Sun, 12 Apr 2015 00:26:43 -0400 |
parents | 32652360d1c3 |
children | 684aadcabcc7 |
files | Modules/_io/fileio.c Modules/posixmodule.c |
diffstat | 2 files changed, 6 insertions(+), 0 deletions(-)[+] [-] Modules/_io/fileio.c 2 Modules/posixmodule.c 4 |
line wrap: on
line diff
--- a/Modules/_io/fileio.c +++ b/Modules/_io/fileio.c @@ -880,12 +880,14 @@ fileio_truncate(fileio *self, PyObject * } Py_BEGIN_ALLOW_THREADS
#ifdef MS_WINDOWS ret = _chsize_s(fd, pos); #else ret = ftruncate(fd, pos); #endif
--- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -8803,11 +8803,13 @@ os_ftruncate_impl(PyModuleDef *module, i do { Py_BEGIN_ALLOW_THREADS
_Py_BEGIN_SUPPRESS_IPH[](#l2.7)
#ifdef MS_WINDOWS result = _chsize_s(fd, length); #else result = ftruncate(fd, length); #endif
} while (result != 0 && errno == EINTR && !(async_err = PyErr_CheckSignals()));_Py_END_SUPPRESS_IPH[](#l2.13) Py_END_ALLOW_THREADS[](#l2.14)
@@ -8843,6 +8845,7 @@ os_truncate_impl(PyModuleDef *module, pa return os_ftruncate_impl(module, path->fd, length); Py_BEGIN_ALLOW_THREADS
#ifdef MS_WINDOWS if (path->wide) fd = _wopen(path->wide, _O_WRONLY | _O_BINARY | _O_NOINHERIT); @@ -8859,6 +8862,7 @@ os_truncate_impl(PyModuleDef *module, pa #else result = truncate(path->narrow, length); #endif