diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2014-11-10 11:25:50 +0200 |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2014-11-10 11:25:50 +0200 |
commit | 5a8dacf9c682734dd96ab25731faf5610179fa57 (patch) | |
tree | 1931eb0feaf349f137ce00beae9553de3668bb6e /Modules/fcntlmodule.c | |
parent | 5f3367721917e417432aca6965575546e396edb2 (diff) | |
parent | d915b0847dd5e43b33cf0683bfc473e904572a56 (diff) | |
download | cpython-git-5a8dacf9c682734dd96ab25731faf5610179fa57.tar.gz |
Issue #22821: Fixed fcntl() with integer argument on 64-bit big-endian
platforms.
Diffstat (limited to 'Modules/fcntlmodule.c')
-rw-r--r-- | Modules/fcntlmodule.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Modules/fcntlmodule.c b/Modules/fcntlmodule.c index 87662dd66e..1f1cef90eb 100644 --- a/Modules/fcntlmodule.c +++ b/Modules/fcntlmodule.c @@ -60,7 +60,7 @@ static PyObject * fcntl_fcntl_impl(PyModuleDef *module, int fd, int code, PyObject *arg) /*[clinic end generated code: output=afc5bfa74a03ef0d input=4850c13a41e86930]*/ { - int int_arg = 0; + unsigned int int_arg = 0; int ret; char *str; Py_ssize_t len; @@ -88,7 +88,7 @@ fcntl_fcntl_impl(PyModuleDef *module, int fd, int code, PyObject *arg) PyErr_Clear(); parse_result = PyArg_Parse(arg, - "l;fcntl requires a file or file descriptor," + "I;fcntl requires a file or file descriptor," " an integer and optionally a third integer or a string", &int_arg); if (!parse_result) { @@ -97,7 +97,7 @@ fcntl_fcntl_impl(PyModuleDef *module, int fd, int code, PyObject *arg) } Py_BEGIN_ALLOW_THREADS - ret = fcntl(fd, code, int_arg); + ret = fcntl(fd, code, (int)int_arg); Py_END_ALLOW_THREADS if (ret < 0) { PyErr_SetFromErrno(PyExc_IOError); |