]> granicus.if.org Git - python/commitdiff
Issue #23668: Suppresses invalid parameter handler around chsize calls.
authorSteve Dower <steve.dower@microsoft.com>
Sun, 12 Apr 2015 04:26:43 +0000 (00:26 -0400)
committerSteve Dower <steve.dower@microsoft.com>
Sun, 12 Apr 2015 04:26:43 +0000 (00:26 -0400)
Modules/_io/fileio.c
Modules/posixmodule.c

index 186319bfdf2c24c594c86e6572fa137268828a38..af93499caed831211c07a389aa09ff4052e10621 100644 (file)
@@ -880,12 +880,14 @@ fileio_truncate(fileio *self, PyObject *args)
     }
 
     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) {
index fcabadd2c893626528e53ea38b1d51b15bbb7dba..82eae5eec4d70af86cef0f164af41a9f02e0668c 100644 (file)
@@ -8803,11 +8803,13 @@ os_ftruncate_impl(PyModuleDef *module, int fd, Py_off_t length)
 
     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 @@ os_truncate_impl(PyModuleDef *module, path_t *path, Py_off_t length)
         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 @@ os_truncate_impl(PyModuleDef *module, path_t *path, Py_off_t length)
 #else
     result = truncate(path->narrow, length);
 #endif
+    _Py_END_SUPPRESS_IPH
     Py_END_ALLOW_THREADS
     if (result < 0)
         return path_error(path);