mirror of
https://github.com/python/cpython.git
synced 2025-12-15 21:44:50 +00:00
Merged revisions 68763,68773 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r68763 | kristjan.jonsson | 2009-01-19 07:10:27 -0600 (Mon, 19 Jan 2009) | 2 lines Issue 4957 Let os.ftruncate raise OSError like documented. ........ r68773 | benjamin.peterson | 2009-01-19 09:51:27 -0600 (Mon, 19 Jan 2009) | 1 line simplify code ........
This commit is contained in:
parent
6214edd1bb
commit
9053d75485
2 changed files with 3 additions and 6 deletions
|
|
@ -5114,10 +5114,8 @@ posix_ftruncate(PyObject *self, PyObject *args)
|
|||
Py_BEGIN_ALLOW_THREADS
|
||||
res = ftruncate(fd, length);
|
||||
Py_END_ALLOW_THREADS
|
||||
if (res < 0) {
|
||||
PyErr_SetFromErrno(PyExc_IOError);
|
||||
return NULL;
|
||||
}
|
||||
if (res < 0)
|
||||
return posix_error();
|
||||
Py_INCREF(Py_None);
|
||||
return Py_None;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue