Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[3.9] bpo-41687: Fix error handling in Solaris sendfile implementation (GH-22128) #22274

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 16, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
bpo-41687: Fix error handling in Solaris sendfile implementation (GH-…
…22128)

I just realized that my recent PR with sendfile on Solaris ([PR 22040](#22040)) has broken error handling.

Sorry for that, this simple followup fixes that.

Automerge-Triggered-By: @1st1
(cherry picked from commit fa8c9e7)

Co-authored-by: Jakub Kulík <Kulikjak@gmail.com>
  • Loading branch information
kulikjak authored and miss-islington committed Sep 16, 2020
commit 94c0e73f47fe24ec0ba66c00b7daf7744c6b4e48
5 changes: 2 additions & 3 deletions 5 Modules/posixmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -9456,14 +9456,13 @@ os_sendfile_impl(PyObject *module, int out_fd, int in_fd, PyObject *offobj,
#if defined(__sun) && defined(__SVR4)
// On Solaris, sendfile raises EINVAL rather than returning 0
// when the offset is equal or bigger than the in_fd size.
int res;
struct stat st;

do {
Py_BEGIN_ALLOW_THREADS
res = fstat(in_fd, &st);
ret = fstat(in_fd, &st);
Py_END_ALLOW_THREADS
} while (res != 0 && errno == EINTR && !(async_err = PyErr_CheckSignals()));
} while (ret != 0 && errno == EINTR && !(async_err = PyErr_CheckSignals()));
if (ret < 0)
return (!async_err) ? posix_error() : NULL;

Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.