aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/bin/psql/common.c9
-rw-r--r--src/bin/psql/common.h3
-rw-r--r--src/bin/psql/startup.c3
3 files changed, 11 insertions, 4 deletions
diff --git a/src/bin/psql/common.c b/src/bin/psql/common.c
index 0089d5d2c81..44278aa9265 100644
--- a/src/bin/psql/common.c
+++ b/src/bin/psql/common.c
@@ -3,7 +3,7 @@
*
* Copyright (c) 2000-2004, PostgreSQL Global Development Group
*
- * $PostgreSQL: pgsql/src/bin/psql/common.c,v 1.93 2004/10/30 23:10:50 tgl Exp $
+ * $PostgreSQL: pgsql/src/bin/psql/common.c,v 1.94 2004/11/01 19:21:50 momjian Exp $
*/
#include "postgres_fe.h"
#include "common.h"
@@ -307,9 +307,14 @@ consoleHandler(DWORD dwCtrlType)
}
void
-setup_cancel_handler(void)
+setup_win32_locks(void)
{
InitializeCriticalSection(&cancelConnLock);
+}
+
+void
+setup_cancel_handler(void)
+{
SetConsoleCtrlHandler(consoleHandler, TRUE);
}
diff --git a/src/bin/psql/common.h b/src/bin/psql/common.h
index cf917cedca9..1f2de0a4f0c 100644
--- a/src/bin/psql/common.h
+++ b/src/bin/psql/common.h
@@ -3,7 +3,7 @@
*
* Copyright (c) 2000-2004, PostgreSQL Global Development Group
*
- * $PostgreSQL: pgsql/src/bin/psql/common.h,v 1.40 2004/10/30 23:10:50 tgl Exp $
+ * $PostgreSQL: pgsql/src/bin/psql/common.h,v 1.41 2004/11/01 19:21:50 momjian Exp $
*/
#ifndef COMMON_H
#define COMMON_H
@@ -49,6 +49,7 @@ extern void ResetCancelConn(void);
#ifndef WIN32
extern void handle_sigint(SIGNAL_ARGS);
#else
+extern void setup_win32_locks(void);
extern void setup_cancel_handler(void);
#endif
diff --git a/src/bin/psql/startup.c b/src/bin/psql/startup.c
index 87f9200d7cd..d7ef12a315a 100644
--- a/src/bin/psql/startup.c
+++ b/src/bin/psql/startup.c
@@ -3,7 +3,7 @@
*
* Copyright (c) 2000-2004, PostgreSQL Global Development Group
*
- * $PostgreSQL: pgsql/src/bin/psql/startup.c,v 1.104 2004/10/16 03:10:16 momjian Exp $
+ * $PostgreSQL: pgsql/src/bin/psql/startup.c,v 1.105 2004/11/01 19:21:50 momjian Exp $
*/
#include "postgres_fe.h"
@@ -121,6 +121,7 @@ main(int argc, char *argv[])
#ifdef WIN32
setvbuf(stderr, NULL, _IONBF, 0);
+ setup_win32_locks();
#endif
pset.cur_cmd_source = stdin;
pset.cur_cmd_interactive = false;