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

Commit fa8c9e7

Browse filesBrowse files
authored
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
1 parent 76553e5 commit fa8c9e7
Copy full SHA for fa8c9e7

File tree

1 file changed

+2
-3
lines changed
Filter options

1 file changed

+2
-3
lines changed

‎Modules/posixmodule.c

Copy file name to clipboardExpand all lines: Modules/posixmodule.c
+2-3Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9521,14 +9521,13 @@ os_sendfile_impl(PyObject *module, int out_fd, int in_fd, PyObject *offobj,
95219521
#if defined(__sun) && defined(__SVR4)
95229522
// On Solaris, sendfile raises EINVAL rather than returning 0
95239523
// when the offset is equal or bigger than the in_fd size.
9524-
int res;
95259524
struct stat st;
95269525

95279526
do {
95289527
Py_BEGIN_ALLOW_THREADS
9529-
res = fstat(in_fd, &st);
9528+
ret = fstat(in_fd, &st);
95309529
Py_END_ALLOW_THREADS
9531-
} while (res != 0 && errno == EINTR && !(async_err = PyErr_CheckSignals()));
9530+
} while (ret != 0 && errno == EINTR && !(async_err = PyErr_CheckSignals()));
95329531
if (ret < 0)
95339532
return (!async_err) ? posix_error() : NULL;
95349533

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.