interesting for MS to catch all those dumps...
Anyway. Oops. Seems I ran my regression tests with the old psql, and
just managed to update the backend, when I tested that patch. Turns out
there are codepaths where we'd access the Critical Section before it was
initialized. Attached patch breaks the initializeation off to a separate
part and adds that one to a much earlier position in the program.
Magnus Hagander
*
* 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"
}
void
-setup_cancel_handler(void)
+setup_win32_locks(void)
{
InitializeCriticalSection(&cancelConnLock);
+}
+
+void
+setup_cancel_handler(void)
+{
SetConsoleCtrlHandler(consoleHandler, TRUE);
}
*
* 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
#ifndef WIN32
extern void handle_sigint(SIGNAL_ARGS);
#else
+extern void setup_win32_locks(void);
extern void setup_cancel_handler(void);
#endif
*
* 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"
#ifdef WIN32
setvbuf(stderr, NULL, _IONBF, 0);
+ setup_win32_locks();
#endif
pset.cur_cmd_source = stdin;
pset.cur_cmd_interactive = false;