postgres.git / summary / log / commit / refs
commit 2176839a4832ad5d19176da2173fec30f78d7bc4
Author: Alvaro Herrera <alvherre@alvh.no-ip.org>
Date: Tue May 09 17:58:51 2017 +0000
First released in: 10.0, 9.3.18, 9.4.13, 9.5.8, 9.6.4
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.
src/bin/pg_dump/pg_backup_db.c | 8 ++++----
1 file 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.
[parent: 34af9129e6b0]