mirror of
https://github.com/postgres/postgres.git
synced 2025-06-29 10:41:53 +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,7 +3,7 @@
|
||||
*
|
||||
* Copyright (c) 2000-2006, PostgreSQL Global Development Group
|
||||
*
|
||||
* $PostgreSQL: pgsql/src/bin/psql/variables.c,v 1.23 2006/03/05 15:58:52 momjian Exp $
|
||||
* $PostgreSQL: pgsql/src/bin/psql/variables.c,v 1.24 2006/06/14 16:49:03 tgl Exp $
|
||||
*/
|
||||
#include "postgres_fe.h"
|
||||
#include "common.h"
|
||||
@ -127,7 +127,11 @@ PrintVariables(VariableSpace space)
|
||||
struct _variable *ptr;
|
||||
|
||||
for (ptr = space->next; ptr; ptr = ptr->next)
|
||||
{
|
||||
printf("%s = '%s'\n", ptr->name, ptr->value);
|
||||
if (cancel_pressed)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
bool
|
||||
|
Reference in New Issue
Block a user