1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-13 07:41:39 +03:00

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.
This commit is contained in:
Tom Lane
2000-12-18 17:33:42 +00:00
parent c431db9714
commit 5491233f52
6 changed files with 79 additions and 16 deletions

View File

@ -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");
}
/*