mirror of
https://github.com/postgres/postgres.git
synced 2025-04-29 13:56:47 +03:00
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.
This commit is contained in:
parent
59fd249a30
commit
a5606579fc
@ -3,7 +3,7 @@
|
|||||||
*
|
*
|
||||||
* Copyright (c) 2000-2006, PostgreSQL Global Development Group
|
* Copyright (c) 2000-2006, PostgreSQL Global Development Group
|
||||||
*
|
*
|
||||||
* $PostgreSQL: pgsql/src/bin/psql/startup.c,v 1.133 2006/06/14 16:49:02 tgl Exp $
|
* $PostgreSQL: pgsql/src/bin/psql/startup.c,v 1.134 2006/06/21 19:40:31 tgl Exp $
|
||||||
*/
|
*/
|
||||||
#include "postgres_fe.h"
|
#include "postgres_fe.h"
|
||||||
|
|
||||||
@ -130,11 +130,14 @@ main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pset.progname = get_progname(argv[0]);
|
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
setvbuf(stderr, NULL, _IONBF, 0);
|
setvbuf(stderr, NULL, _IONBF, 0);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
setup_cancel_handler();
|
||||||
|
|
||||||
|
pset.progname = get_progname(argv[0]);
|
||||||
|
|
||||||
setDecimalLocale();
|
setDecimalLocale();
|
||||||
pset.cur_cmd_source = stdin;
|
pset.cur_cmd_source = stdin;
|
||||||
pset.cur_cmd_interactive = false;
|
pset.cur_cmd_interactive = false;
|
||||||
@ -370,9 +373,6 @@ main(int argc, char *argv[])
|
|||||||
if (options.action_string) /* -f - was used */
|
if (options.action_string) /* -f - was used */
|
||||||
pset.inputfile = "<stdin>";
|
pset.inputfile = "<stdin>";
|
||||||
|
|
||||||
/* establish control-C handling for interactive operation */
|
|
||||||
setup_cancel_handler();
|
|
||||||
|
|
||||||
successResult = MainLoop(stdin);
|
successResult = MainLoop(stdin);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user