mirror of
https://github.com/postgres/postgres.git
synced 2025-12-13 14:22:43 +03:00
Clean up psql's control-C handling to avoid longjmp'ing out of random
places --- that risks corrupting data structures, losing sync with the backend, etc. We now longjmp only from calls to readline, fgets, and fread, which we assume are coded to protect themselves against interrupts at undesirable times. This requires adding explicit tests for cancel_pressed in long-running loops, but on the whole it's far cleaner. Martijn van Oosterhout and Tom Lane.
This commit is contained in:
@@ -3,18 +3,13 @@
|
||||
*
|
||||
* Copyright (c) 2000-2006, PostgreSQL Global Development Group
|
||||
*
|
||||
* $PostgreSQL: pgsql/src/bin/psql/mainloop.h,v 1.18 2006/03/05 15:58:51 momjian Exp $
|
||||
* $PostgreSQL: pgsql/src/bin/psql/mainloop.h,v 1.19 2006/06/14 16:49:02 tgl Exp $
|
||||
*/
|
||||
#ifndef MAINLOOP_H
|
||||
#define MAINLOOP_H
|
||||
|
||||
#include "postgres_fe.h"
|
||||
#include <stdio.h>
|
||||
#ifndef WIN32
|
||||
#include <setjmp.h>
|
||||
|
||||
extern sigjmp_buf main_loop_jmp;
|
||||
#endif
|
||||
|
||||
int MainLoop(FILE *source);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user