summaryrefslogtreecommitdiff
path: root/src/bin/pg_dump/pg_backup_db.c
diff options
context:
space:
mode:
authorAlvaro Herrera <alvherre@alvh.no-ip.org>2017-05-09 14:58:51 -0300
committerAlvaro Herrera <alvherre@alvh.no-ip.org>2017-05-09 14:58:51 -0300
commite7226dc3eb39d91fb999d58ef52121dd3c8ee9fc (patch)
tree31306b30d33a56123ecaf93b1fdc904fc0b05f37 /src/bin/pg_dump/pg_backup_db.c
parentaa3bcba08d466bc6fd2558f8f0bf0e6d6c89b58b (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.c8
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 b01b174d9db..ce60b4db8aa 100644
--- a/src/bin/pg_dump/pg_backup_db.c
+++ b/src/bin/pg_dump/pg_backup_db.c
@@ -359,12 +359,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.