pgsql: Fix "variable set but not used" warning with unnamed POSIX semap
Fix "variable set but not used" warning with unnamed POSIX semaphores.
Late-model clang is able to notice, when building posix_sema.c with
USE_NAMED_POSIX_SEMAPHORES not defined, that the static variable
nextSemKey is set once and read nowhere. Rearrange the #ifdef's
to not declare or set it unless USE_NAMED_POSIX_SEMAPHORES. As a
small side benefit, we can skip a stat() call altogether if we're
not going to need it to initialize this variable, which I think
clarifies the code a fraction.
Per buildfarm member fritillary.
Branch
------
REL_14_STABLE
Details
-------
https://git.postgresql.org/pg/commitdiff/cfd97fa13d15f8138a6046173f6bd6dbd6b3c63e
Modified Files
--------------
src/backend/port/posix_sema.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)