diff options
author | Alvaro Herrera <alvherre@alvh.no-ip.org> | 2017-05-09 14:58:51 -0300 |
---|---|---|
committer | Alvaro Herrera <alvherre@alvh.no-ip.org> | 2017-05-09 14:58:51 -0300 |
commit | bfaba24829f511c509557ffc718ac75fb580dca7 (patch) | |
tree | 040e17830a93670bd71a7452444197ce5f7cfb89 /src/bin/pg_dump/pg_backup_db.c | |
parent | ca9cfed883333d5801716eb01cf28b6b5be2b5cd (diff) |
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.
Diffstat (limited to 'src/bin/pg_dump/pg_backup_db.c')
-rw-r--r-- | src/bin/pg_dump/pg_backup_db.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/bin/pg_dump/pg_backup_db.c b/src/bin/pg_dump/pg_backup_db.c index d2a3de3c5de..1cf5a505e02 100644 --- a/src/bin/pg_dump/pg_backup_db.c +++ b/src/bin/pg_dump/pg_backup_db.c @@ -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. |