Explicitly ignore guaranteed-true result from pgstat_lock_entry().
authorTom Lane <[email protected]>
Mon, 11 Apr 2022 17:22:37 +0000 (13:22 -0400)
committerTom Lane <[email protected]>
Mon, 11 Apr 2022 17:22:37 +0000 (13:22 -0400)
With nowait passed as false, pgstat_lock_entry() must return true
so there's no need to check its result.  Coverity seems unconvinced
of this, so whack it upside the head with a (void) cast.

src/backend/utils/activity/pgstat_shmem.c

index b270c504ea6b25827144d21ae6b5af8f4b2320ed..68ff6f51fcfa4950bbe9ba9bd3e990f895923aa1 100644 (file)
@@ -920,7 +920,7 @@ pgstat_reset_entry(PgStat_Kind kind, Oid dboid, Oid objoid, TimestampTz ts)
        if (!entry_ref || entry_ref->shared_entry->dropped)
                return;
 
-       pgstat_lock_entry(entry_ref, false);
+       (void) pgstat_lock_entry(entry_ref, false);
        shared_stat_reset_contents(kind, entry_ref->shared_stats, ts);
        pgstat_unlock_entry(entry_ref);
 }