Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitaf331e2

Browse files
committed
Ensure that we only create one ConsoleCtrlHandler per psql process,
so as to avoid performance issues and possible ultimate crash on longpsql scripts. Per Merlin Moncure.
1 parent081ed99 commitaf331e2

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

‎src/bin/psql/common.c

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* Copyright (c) 2000-2005, PostgreSQL Global Development Group
55
*
6-
* $PostgreSQL: pgsql/src/bin/psql/common.c,v 1.109 2005/10/27 13:34:47 momjian Exp $
6+
* $PostgreSQL: pgsql/src/bin/psql/common.c,v 1.110 2005/11/04 18:35:40 tgl Exp $
77
*/
88
#include"postgres_fe.h"
99
#include"common.h"
@@ -268,6 +268,7 @@ handle_sigint(SIGNAL_ARGS)
268268
}
269269
errno=save_errno;/* just in case the write changed it */
270270
}
271+
271272
#else/* WIN32 */
272273

273274
staticBOOLWINAPI
@@ -313,8 +314,16 @@ setup_win32_locks(void)
313314
void
314315
setup_cancel_handler(void)
315316
{
316-
SetConsoleCtrlHandler(consoleHandler, TRUE);
317+
staticbooldone= false;
318+
319+
/* only need one handler per process */
320+
if (!done)
321+
{
322+
SetConsoleCtrlHandler(consoleHandler, TRUE);
323+
done= true;
324+
}
317325
}
326+
318327
#endif/* WIN32 */
319328

320329

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp