From: Arshia Ghafoori Date: Wed, 27 Aug 2025 10:26:01 +0000 (+0400) Subject: fix(c): fix polling for read+write X-Git-Tag: 3.2.11~9^2~6 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=84a0edfa05e8f60e7c47bdd2f44c3215fb206c67;p=thirdparty%2Fpsycopg.git fix(c): fix polling for read+write --- diff --git a/docs/news.rst b/docs/news.rst index d859534dc..7c3d6929e 100644 --- a/docs/news.rst +++ b/docs/news.rst @@ -13,6 +13,7 @@ Future releases Psycopg 3.2.11 (unreleased) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +- Fix spurious readiness flags in some of the wait functions (:ticket:`#1141`). - Fix bad data on error in binary copy (:ticket:`#1147`). - Don't raise warning, and don't leak resources, if a builtin function is used as JSON dumper/loader function (:ticket:`#1165`). diff --git a/psycopg_c/psycopg_c/_psycopg/waiting.pyx b/psycopg_c/psycopg_c/_psycopg/waiting.pyx index ed04bb472..625b42d5e 100644 --- a/psycopg_c/psycopg_c/_psycopg/waiting.pyx +++ b/psycopg_c/psycopg_c/_psycopg/waiting.pyx @@ -88,8 +88,8 @@ retry_eintr: rv = 0; /* success, maybe with timeout */ if (select_rv >= 0) { - if (input_fd.events & POLLIN) { rv |= SELECT_EV_READ; } - if (input_fd.events & POLLOUT) { rv |= SELECT_EV_WRITE; } + if (input_fd.revents & POLLIN) { rv |= SELECT_EV_READ; } + if (input_fd.revents & POLLOUT) { rv |= SELECT_EV_WRITE; } } #else