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 | 2176839a4832ad5d19176da2173fec30f78d7bc4 (patch) | |
tree | a52c80c6092db249b9ea5106124ac91183b89009 | |
parent | 34af9129e6b0f163e03fac55b7ffa71aa925d4c7 (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.
-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 b05dcec1012..e4b58d58aee 100644 --- a/src/bin/pg_dump/pg_backup_db.c +++ b/src/bin/pg_dump/pg_backup_db.c @@ -342,12 +342,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. |