]> git.ipfire.org Git - thirdparty/psycopg.git/commitdiff
fix(c): fix polling for read+write
authorArshia Ghafoori <arshia001@live.com>
Wed, 27 Aug 2025 10:26:01 +0000 (14:26 +0400)
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>
Mon, 13 Oct 2025 01:25:16 +0000 (03:25 +0200)
docs/news.rst
psycopg_c/psycopg_c/_psycopg/waiting.pyx

index 60c3cb36a48fb3254e3f7f2a0b9605604a2ac2a0..7487d2d34923a7da88b97e04e45673f607039fb9 100644 (file)
@@ -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`).
index ed04bb47215468162e4efea9237f5339b9631772..625b42d5e65774d71b890afb96f2073a76b41daa 100644 (file)
@@ -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