Skip to content

Commit 82f8c45

Browse files
committed
pg_alterckey: adjust doc build and Win32 sleep/open build fails
Fix for commit 62afb42. Reported-by: Tom Lane Discussion: https://postgr.es/m/1252111.1608953815@sss.pgh.pa.us Backpatch-through: master
1 parent 7705f8c commit 82f8c45

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

doc/src/sgml/ref/allfiles.sgml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,7 @@ Complete list of usable sgml source files in this directory.
189189
<!ENTITY values SYSTEM "values.sgml">
190190

191191
<!-- applications and utilities -->
192+
<!ENTITY pgalterckey SYSTEM "pg_alterckey.sgml">
192193
<!ENTITY clusterdb SYSTEM "clusterdb.sgml">
193194
<!ENTITY createdb SYSTEM "createdb.sgml">
194195
<!ENTITY createuser SYSTEM "createuser.sgml">
@@ -215,7 +216,7 @@ Complete list of usable sgml source files in this directory.
215216
<!ENTITY pgtestfsync SYSTEM "pgtestfsync.sgml">
216217
<!ENTITY pgtesttiming SYSTEM "pgtesttiming.sgml">
217218
<!ENTITY pgupgrade SYSTEM "pgupgrade.sgml">
218-
<!ENTITY pgwaldump SYSTEM "pg_waldump.sgml">
219+
<!ENTITY pgwaldump SYSTEM "pg_waldump.sgml">
219220
<!ENTITY postgres SYSTEM "postgres-ref.sgml">
220221
<!ENTITY postmaster SYSTEM "postmaster.sgml">
221222
<!ENTITY psqlRef SYSTEM "psql-ref.sgml">

src/bin/pg_alterckey/pg_alterckey.c

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -343,16 +343,17 @@ create_lockfile(void)
343343
unlink(pid_path);
344344

345345
/* Sleep to reduce the likelihood of concurrent unlink */
346-
sleep(2);
346+
pg_usleep(2000000L); /* 2 seconds */
347347
}
348348

349349
/* Create our own lockfile? */
350-
lock_fd = open(pid_path, O_RDWR | O_CREAT | O_EXCL
351-
#ifdef WIN32
352-
/* delete on close */
353-
| O_TEMPORARY
350+
#ifndef WIN32
351+
lock_fd = open(pid_path, O_RDWR | O_CREAT | O_EXCL, pg_file_create_mode);
352+
#else
353+
/* delete on close */
354+
lock_fd = open(pid_path, O_RDWR | O_CREAT | O_EXCL | O_TEMPORARY,
355+
pg_file_create_mode);
354356
#endif
355-
, pg_file_create_mode);
356357

357358
if (lock_fd == -1)
358359
{

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy