summaryrefslogtreecommitdiffstats
path: root/Modules/signalmodule.c
diff options
context:
space:
mode:
authorSteve Dower <steve.dower@microsoft.com>2015-02-21 16:44:05 (GMT)
committerSteve Dower <steve.dower@microsoft.com>2015-02-21 16:44:05 (GMT)
commitf2f373f5931be48efc3f6fa2c2faa1cca79dce75 (patch)
tree87facdec6423b6282ad5c4e2cf30e124d4a5de40 /Modules/signalmodule.c
parent18d1924987d75ef43a429fe4b6f05df2c308ec2a (diff)
downloadcpython-f2f373f5931be48efc3f6fa2c2faa1cca79dce75.zip
cpython-f2f373f5931be48efc3f6fa2c2faa1cca79dce75.tar.gz
cpython-f2f373f5931be48efc3f6fa2c2faa1cca79dce75.tar.bz2
Issue #23152: Implement _Py_fstat() to support files larger than 2 GB on Windows.
fstat() may fail with EOVERFLOW on files larger than 2 GB because the file size type is an signed 32-bit integer.
Diffstat (limited to 'Modules/signalmodule.c')
-rw-r--r--Modules/signalmodule.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/Modules/signalmodule.c b/Modules/signalmodule.c
index 2f2b260..598bc8a 100644
--- a/Modules/signalmodule.c
+++ b/Modules/signalmodule.c
@@ -503,13 +503,13 @@ signal_siginterrupt(PyObject *self, PyObject *args)
static PyObject *
signal_set_wakeup_fd(PyObject *self, PyObject *args)
{
+ struct _Py_stat_struct st;
#ifdef MS_WINDOWS
PyObject *fdobj;
SOCKET_T sockfd, old_sockfd;
int res;
int res_size = sizeof res;
PyObject *mod;
- struct stat st;
int is_socket;
if (!PyArg_ParseTuple(args, "O:set_wakeup_fd", &fdobj))
@@ -520,7 +520,6 @@ signal_set_wakeup_fd(PyObject *self, PyObject *args)
return NULL;
#else
int fd, old_fd;
- struct stat st;
if (!PyArg_ParseTuple(args, "i:set_wakeup_fd", &fd))
return NULL;
@@ -560,7 +559,7 @@ signal_set_wakeup_fd(PyObject *self, PyObject *args)
return NULL;
}
- if (fstat(fd, &st) != 0) {
+ if (_Py_fstat(fd, &st) != 0) {
PyErr_SetFromErrno(PyExc_OSError);
return NULL;
}
@@ -592,7 +591,7 @@ signal_set_wakeup_fd(PyObject *self, PyObject *args)
return NULL;
}
- if (fstat(fd, &st) != 0) {
+ if (_Py_fstat(fd, &st) != 0) {
PyErr_SetFromErrno(PyExc_OSError);
return NULL;
}