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 | e0bf16060be695ced920727fa29f0d9ede61bd3f (patch) | |
tree | 827ce8bffc85dbdbeb5b70879a95dc013f3486c0 | |
parent | 26aa1cf376f68b800b73c326edeea6d1996ec246 (diff) | |
download | postgresql-e0bf16060be695ced920727fa29f0d9ede61bd3f.tar.gz postgresql-e0bf16060be695ced920727fa29f0d9ede61bd3f.zip |
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 | ||||
-rw-r--r-- | src/bin/scripts/vacuumdb.c | 2 |
2 files changed, 5 insertions, 5 deletions
diff --git a/src/bin/pg_dump/pg_backup_db.c b/src/bin/pg_dump/pg_backup_db.c index 2e7d23409af..b01a5f0cf0e 100644 --- a/src/bin/pg_dump/pg_backup_db.c +++ b/src/bin/pg_dump/pg_backup_db.c @@ -351,12 +351,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. diff --git a/src/bin/scripts/vacuumdb.c b/src/bin/scripts/vacuumdb.c index e2b187eab3a..97792d0720e 100644 --- a/src/bin/scripts/vacuumdb.c +++ b/src/bin/scripts/vacuumdb.c @@ -860,7 +860,7 @@ DisconnectDatabase(ParallelSlot *slot) if ((cancel = PQgetCancel(slot->connection))) { - PQcancel(cancel, errbuf, sizeof(errbuf)); + (void) PQcancel(cancel, errbuf, sizeof(errbuf)); PQfreeCancel(cancel); } } |