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/commands/async.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/commands/async.c')
-rw-r--r-- | src/backend/commands/async.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/backend/commands/async.c b/src/backend/commands/async.c index 6316262d042..b86f2421eb8 100644 --- a/src/backend/commands/async.c +++ b/src/backend/commands/async.c @@ -7,7 +7,7 @@ * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/commands/async.c,v 1.73 2000/11/28 23:27:54 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/commands/async.c,v 1.74 2000/12/18 17:33:40 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -589,6 +589,7 @@ AtAbort_Notify() void Async_NotifyHandler(SIGNAL_ARGS) { + int save_errno = errno; /* * Note: this is a SIGNAL HANDLER. You must be very wary what you do @@ -637,6 +638,8 @@ Async_NotifyHandler(SIGNAL_ARGS) */ notifyInterruptOccurred = 1; } + + errno = save_errno; } /* |