Skip to content

Commit a560657

Browse files
committed
Move setup_cancel_handler() up near start of psql main(), where the
setup_win32_locks() call formerly was, to ensure that cancelConnLock is valid when it needs to be. Per Yoshiyuki Asaba.
1 parent 59fd249 commit a560657

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/bin/psql/startup.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* Copyright (c) 2000-2006, PostgreSQL Global Development Group
55
*
6-
* $PostgreSQL: pgsql/src/bin/psql/startup.c,v 1.133 2006/06/14 16:49:02 tgl Exp $
6+
* $PostgreSQL: pgsql/src/bin/psql/startup.c,v 1.134 2006/06/21 19:40:31 tgl Exp $
77
*/
88
#include "postgres_fe.h"
99

@@ -130,11 +130,14 @@ main(int argc, char *argv[])
130130
}
131131
}
132132

133-
pset.progname = get_progname(argv[0]);
134-
135133
#ifdef WIN32
136134
setvbuf(stderr, NULL, _IONBF, 0);
137135
#endif
136+
137+
setup_cancel_handler();
138+
139+
pset.progname = get_progname(argv[0]);
140+
138141
setDecimalLocale();
139142
pset.cur_cmd_source = stdin;
140143
pset.cur_cmd_interactive = false;
@@ -370,9 +373,6 @@ main(int argc, char *argv[])
370373
if (options.action_string) /* -f - was used */
371374
pset.inputfile = "<stdin>";
372375

373-
/* establish control-C handling for interactive operation */
374-
setup_cancel_handler();
375-
376376
successResult = MainLoop(stdin);
377377
}
378378

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