1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-24 14:22:24 +03:00
Files
postgres/src
Tom Lane 43b73d1a40 Fix latent portability issue in pgwin32_dispatch_queued_signals().
The first iteration of the signal-checking loop would compute sigmask(0)
which expands to 1<<(-1) which is undefined behavior according to the
C standard.  The lack of field reports of trouble suggest that it
evaluates to 0 on all existing Windows compilers, but that's hardly
something to rely on.  Since signal 0 isn't a queueable signal anyway,
we can just make the loop iterate from 1 instead, and save a few cycles
as well as avoiding the undefined behavior.

In passing, avoid evaluating the volatile expression UNBLOCKED_SIGNAL_QUEUE
twice in a row; there's no reason to waste cycles like that.

Noted by Aleksander Alekseev, though this isn't his proposed fix.
Back-patch to all supported branches.
2016-04-04 11:13:35 -04:00
..
2016-03-28 08:50:07 +02:00
2016-03-28 16:12:29 -04:00
2016-03-28 08:50:07 +02:00