mirror of
https://github.com/postgres/postgres.git
synced 2025-08-12 15:23:02 +03:00
Ignore PQcancel errors properly
Add a (void) cast to all PQcancel() calls that purposefully don't check the return value, to keep compilers and static checkers happy. Per Coverity.
This commit is contained in:
@@ -342,12 +342,12 @@ DisconnectDatabase(Archive *AHX)
|
|||||||
if (AH->connCancel)
|
if (AH->connCancel)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* If we have an active query, send a cancel before closing. This is
|
* If we have an active query, send a cancel before closing, ignoring
|
||||||
* of no use for a normal exit, but might be helpful during
|
* any errors. This is of no use for a normal exit, but might be
|
||||||
* exit_horribly().
|
* helpful during exit_horribly().
|
||||||
*/
|
*/
|
||||||
if (PQtransactionStatus(AH->connection) == PQTRANS_ACTIVE)
|
if (PQtransactionStatus(AH->connection) == PQTRANS_ACTIVE)
|
||||||
PQcancel(AH->connCancel, errbuf, sizeof(errbuf));
|
(void) PQcancel(AH->connCancel, errbuf, sizeof(errbuf));
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Prevent signal handler from sending a cancel after this.
|
* Prevent signal handler from sending a cancel after this.
|
||||||
|
Reference in New Issue
Block a user