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 6a39888

Browse filesBrowse files
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>
1 parent 7e356f1 commit 6a39888
Copy full SHA for 6a39888

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
@@ -9456,14 +9456,13 @@ os_sendfile_impl(PyObject *module, int out_fd, int in_fd, PyObject *offobj,
94569456
#if defined(__sun) && defined(__SVR4)
94579457
// On Solaris, sendfile raises EINVAL rather than returning 0
94589458
// when the offset is equal or bigger than the in_fd size.
9459-
int res;
94609459
struct stat st;
94619460

94629461
do {
94639462
Py_BEGIN_ALLOW_THREADS
9464-
res = fstat(in_fd, &st);
9463+
ret = fstat(in_fd, &st);
94659464
Py_END_ALLOW_THREADS
9466-
} while (res != 0 && errno == EINTR && !(async_err = PyErr_CheckSignals()));
9465+
} while (ret != 0 && errno == EINTR && !(async_err = PyErr_CheckSignals()));
94679466
if (ret < 0)
94689467
return (!async_err) ? posix_error() : NULL;
94699468

0 commit comments

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