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
a4e443fb
Commit
a4e443fb
authored
Apr 12, 2015
by
Steve Dower
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #23668: Suppresses invalid parameter handler around chsize calls.
parent
cbd4a5c9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
0 deletions
+6
-0
Modules/_io/fileio.c
Modules/_io/fileio.c
+2
-0
Modules/posixmodule.c
Modules/posixmodule.c
+4
-0
No files found.
Modules/_io/fileio.c
View file @
a4e443fb
...
...
@@ -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
)
{
...
...
Modules/posixmodule.c
View file @
a4e443fb
...
...
@@ -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
);
...
...
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