Content-Length: 265469 | pFad | http://github.com/postgrespro/postgres/commit/93b99d3b6aec67a5eac30c67c511dbb03dd2f72c

55 Register atexit hook only once in pg_upgrade. · postgrespro/postgres@93b99d3 · GitHub
Skip to content

Commit 93b99d3

Browse files
committed
Register atexit hook only once in pg_upgrade.
start_postmaster() registered stop_postmaster_atexit as an atexit(3) callback each time through, although the obvious intention was to do so only once per program run. The extra registrations were harmless, so long as we didn't exceed ATEXIT_MAX, but still it's a bug. Artur Zakirov, with bikeshedding by Kyotaro Horiguchi and me Discussion: <d279e817-02b5-caa6-215f-cfb05dce109a@postgrespro.ru>
1 parent 6b8a89e commit 93b99d3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/bin/pg_upgrade/server.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,10 +174,11 @@ start_postmaster(ClusterInfo *cluster, bool throw_error)
174174
{
175175
char cmd[MAXPGPATH * 4 + 1000];
176176
PGconn *conn;
177-
bool exit_hook_registered = false;
178177
bool pg_ctl_return = false;
179178
char socket_string[MAXPGPATH + 200];
180179

180+
static bool exit_hook_registered = false;
181+
181182
if (!exit_hook_registered)
182183
{
183184
atexit(stop_postmaster_atexit);

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/postgrespro/postgres/commit/93b99d3b6aec67a5eac30c67c511dbb03dd2f72c

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy