summaryrefslogtreecommitdiffstats
path: root/Modules/posixmodule.c
diff options
context:
space:
mode:
authorHirokazu Yamamoto <ocean-city@m2.ccsnet.ne.jp>2010-12-05 04:16:47 (GMT)
committerHirokazu Yamamoto <ocean-city@m2.ccsnet.ne.jp>2010-12-05 04:16:47 (GMT)
commit26253bb09e3283922b01f563680a0ad3791235ed (patch)
treef04db49235a1cb81ad5eb1d3ab862f108a019296 /Modules/posixmodule.c
parent43b5a857d62eb56ed14887acd8fce2f32c915d2e (diff)
downloadcpython-26253bb09e3283922b01f563680a0ad3791235ed.zip
cpython-26253bb09e3283922b01f563680a0ad3791235ed.tar.gz
cpython-26253bb09e3283922b01f563680a0ad3791235ed.tar.bz2
Should use posix_error here.
Diffstat (limited to 'Modules/posixmodule.c')
-rw-r--r--Modules/posixmodule.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c
index 34190dd..01da01d 100644
--- a/Modules/posixmodule.c
+++ b/Modules/posixmodule.c
@@ -2803,14 +2803,12 @@ posix__getfileinformation(PyObject *self, PyObject *args)
if (!PyArg_ParseTuple(args, "i:_getfileinformation", &fd))
return NULL;
- if (!_PyVerify_fd(fd)) {
- PyErr_SetString(PyExc_ValueError, "received invalid file descriptor");
- return NULL;
- }
+ if (!_PyVerify_fd(fd))
+ return posix_error();
hFile = (HANDLE)_get_osfhandle(fd);
if (hFile == INVALID_HANDLE_VALUE)
- return win32_error("_getfileinformation", NULL);
+ return posix_error();
if (!GetFileInformationByHandle(hFile, &info))
return win32_error("_getfileinformation", NULL);