]> git.ipfire.org Git - thirdparty/psycopg.git/commitdiff
fix(c): fix the goto label in the HAVE_POLL branch of wait_c_impl()
authorDenis Laxalde <denis.laxalde@dalibo.com>
Tue, 16 Apr 2024 14:21:16 +0000 (16:21 +0200)
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>
Tue, 16 Apr 2024 18:12:49 +0000 (20:12 +0200)
This resolves the following warning when building the extension module:

    $ python psycopg_c/setup.py build_ext -i
    [...]
    building 'psycopg_c._psycopg' extension
    x86_64-linux-gnu-gcc -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -I/home/denis/.local/pgsql/include -I/home/denis/src/psycopg3/.venv/include -I/usr/include/python3.11 -c psycopg_c/_psycopg.c -o build/temp.linux-x86_64-cpython-311/psycopg_c/_psycopg.o
    psycopg_c/_psycopg.c: In function ‘wait_c_impl’:
    psycopg_c/_psycopg.c:1649:1: warning: label ‘error’ defined but not used [-Wunused-label]
     1649 |
          | ^

psycopg_c/psycopg_c/_psycopg/waiting.pyx

index d11a2d9c09e11383ff6f38fcf163c2e53d811a91..6b22baf2cb57cf149f55de3a57e2081e06aa945d 100644 (file)
@@ -84,7 +84,7 @@ retry_eintr:
     }
 
     if (PyErr_CheckSignals()) { goto finally; }
-    if (select_rv < 0) { goto finally; }  /* poll error */
+    if (select_rv < 0) { goto error; }  /* poll error */
 
     rv = 0;  /* success, maybe with timeout */
     if (select_rv >= 0) {