diff options
author | Jakub KulĂk <Kulikjak@gmail.com> | 2020-09-09 19:29:42 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-09 19:29:42 (GMT) |
commit | fa8c9e70104b0aef966a518eb3a80a4881906ae0 (patch) | |
tree | e630d89500d359b5534786aca63a53f8534f79d1 /Modules/posixmodule.c | |
parent | 76553e5d2eae3e8a47406a6de4f354fe33ff370b (diff) | |
download | cpython-fa8c9e70104b0aef966a518eb3a80a4881906ae0.zip cpython-fa8c9e70104b0aef966a518eb3a80a4881906ae0.tar.gz cpython-fa8c9e70104b0aef966a518eb3a80a4881906ae0.tar.bz2 |
bpo-41687: Fix error handling in Solaris sendfile implementation (GH-22128)
I just realized that my recent PR with sendfile on Solaris ([PR 22040](https://github.com/python/cpython/pull/22040)) has broken error handling.
Sorry for that, this simple followup fixes that.
Automerge-Triggered-By: @1st1
Diffstat (limited to 'Modules/posixmodule.c')
-rw-r--r-- | Modules/posixmodule.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index 00ba758..7c49693 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -9521,14 +9521,13 @@ done: #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; |