mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-08-28 07:17:20 +02: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:
parent
ca9cfed883
commit
bfaba24829
@ -360,12 +360,12 @@ DisconnectDatabase(Archive *AHX)
|
||||
if (AH->connCancel)
|
||||
{
|
||||
/*
|
||||
* If we have an active query, send a cancel before closing. This is
|
||||
* of no use for a normal exit, but might be helpful during
|
||||
* exit_horribly().
|
||||
* If we have an active query, send a cancel before closing, ignoring
|
||||
* any errors. This is of no use for a normal exit, but might be
|
||||
* helpful during exit_horribly().
|
||||
*/
|
||||
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.
|
||||
|
@ -854,7 +854,7 @@ DisconnectDatabase(ParallelSlot *slot)
|
||||
|
||||
if ((cancel = PQgetCancel(slot->connection)))
|
||||
{
|
||||
PQcancel(cancel, errbuf, sizeof(errbuf));
|
||||
(void) PQcancel(cancel, errbuf, sizeof(errbuf));
|
||||
PQfreeCancel(cancel);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user