mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
gh-110093: Replace trivial Py_BuildValue() with direct C API call (GH-110094)
This commit is contained in:
parent
ff4e53cb74
commit
59ea0f523e
13 changed files with 33 additions and 32 deletions
|
@ -11276,9 +11276,9 @@ os_sendfile_impl(PyObject *module, int out_fd, int in_fd, PyObject *offobj,
|
|||
|
||||
done:
|
||||
#if !defined(HAVE_LARGEFILE_SUPPORT)
|
||||
return Py_BuildValue("l", sbytes);
|
||||
return PyLong_FromLong(sbytes);
|
||||
#else
|
||||
return Py_BuildValue("L", sbytes);
|
||||
return PyLong_FromLongLong(sbytes);
|
||||
#endif
|
||||
|
||||
#else
|
||||
|
@ -11291,7 +11291,7 @@ done:
|
|||
} while (ret < 0 && errno == EINTR && !(async_err = PyErr_CheckSignals()));
|
||||
if (ret < 0)
|
||||
return (!async_err) ? posix_error() : NULL;
|
||||
return Py_BuildValue("n", ret);
|
||||
return PyLong_FromSsize_t(ret);
|
||||
}
|
||||
#endif
|
||||
off_t offset;
|
||||
|
@ -11312,7 +11312,7 @@ done:
|
|||
return (!async_err) ? posix_error() : NULL;
|
||||
|
||||
if (offset >= st.st_size) {
|
||||
return Py_BuildValue("i", 0);
|
||||
return PyLong_FromLong(0);
|
||||
}
|
||||
|
||||
// On illumos specifically sendfile() may perform a partial write but
|
||||
|
@ -11338,7 +11338,7 @@ done:
|
|||
} while (ret < 0 && errno == EINTR && !(async_err = PyErr_CheckSignals()));
|
||||
if (ret < 0)
|
||||
return (!async_err) ? posix_error() : NULL;
|
||||
return Py_BuildValue("n", ret);
|
||||
return PyLong_FromSsize_t(ret);
|
||||
#endif
|
||||
}
|
||||
#endif /* HAVE_SENDFILE */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue