From: Arshia Ghafoori Date: Wed, 27 Aug 2025 10:26:01 +0000 (+0400) Subject: fix(c): fix polling for read+write X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f5c4482360c012e3fa2234e285a2d12011d4c9f7;p=thirdparty%2Fpsycopg.git fix(c): fix polling for read+write --- diff --git a/docs/news.rst b/docs/news.rst index 60c3cb36a..7487d2d34 100644 --- a/docs/news.rst +++ b/docs/news.rst @@ -46,6 +46,7 @@ Psycopg 3.3.0 (unreleased) 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