diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2000-12-18 17:33:42 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2000-12-18 17:33:42 +0000 |
commit | 5491233f5245c464be2286ad894448b21ef757db (patch) | |
tree | 8badaae022de82ec4cd53ffe42e2c22e681c394d /src/backend/tcop/postgres.c | |
parent | c431db9714bfca24f05fd301ae2f027f83689e4f (diff) | |
download | postgresql-5491233f5245c464be2286ad894448b21ef757db.tar.gz postgresql-5491233f5245c464be2286ad894448b21ef757db.zip |
Ensure that 'errno' is saved and restored by all signal handlers that
might change it. Experimentation shows that the signal handler call
mechanism does not save/restore errno for you, at least not on Linux
or HPUX, so this is definitely a real risk.
Diffstat (limited to 'src/backend/tcop/postgres.c')
-rw-r--r-- | src/backend/tcop/postgres.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/backend/tcop/postgres.c b/src/backend/tcop/postgres.c index 706b5d1fbf1..02c1459052d 100644 --- a/src/backend/tcop/postgres.c +++ b/src/backend/tcop/postgres.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.195 2000/12/18 00:44:47 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.196 2000/12/18 17:33:41 tgl Exp $ * * NOTES * this is the "main" module of the postgres backend and @@ -984,8 +984,11 @@ FloatExceptionHandler(SIGNAL_ARGS) static void QueryCancelHandler(SIGNAL_ARGS) { + int save_errno = errno; + QueryCancel = true; LockWaitCancel(); + errno = save_errno; } void @@ -1646,7 +1649,7 @@ PostgresMain(int argc, char *argv[], int real_argc, char *real_argv[], const cha if (!IsUnderPostmaster) { puts("\nPOSTGRES backend interactive interface "); - puts("$Revision: 1.195 $ $Date: 2000/12/18 00:44:47 $\n"); + puts("$Revision: 1.196 $ $Date: 2000/12/18 17:33:41 $\n"); } /* |