Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commite0bf160

Browse files
committed
Ignore PQcancel errors properly
Add a (void) cast to all PQcancel() calls that purposefully don't checkthe return value, to keep compilers and static checkers happy.Per Coverity.
1 parent26aa1cf commite0bf160

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

‎src/bin/pg_dump/pg_backup_db.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -351,12 +351,12 @@ DisconnectDatabase(Archive *AHX)
351351
if (AH->connCancel)
352352
{
353353
/*
354-
* If we have an active query, send a cancel before closing. This is
355-
* of no use for a normal exit, but might be helpful during
356-
* exit_horribly().
354+
* If we have an active query, send a cancel before closing, ignoring
355+
*any errors. This isof no use for a normal exit, but might be
356+
*helpful duringexit_horribly().
357357
*/
358358
if (PQtransactionStatus(AH->connection)==PQTRANS_ACTIVE)
359-
PQcancel(AH->connCancel,errbuf,sizeof(errbuf));
359+
(void)PQcancel(AH->connCancel,errbuf,sizeof(errbuf));
360360

361361
/*
362362
* Prevent signal handler from sending a cancel after this.

‎src/bin/scripts/vacuumdb.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -860,7 +860,7 @@ DisconnectDatabase(ParallelSlot *slot)
860860

861861
if ((cancel=PQgetCancel(slot->connection)))
862862
{
863-
PQcancel(cancel,errbuf,sizeof(errbuf));
863+
(void)PQcancel(cancel,errbuf,sizeof(errbuf));
864864
PQfreeCancel(cancel);
865865
}
866866
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp