From 5491233f5245c464be2286ad894448b21ef757db Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Mon, 18 Dec 2000 17:33:42 +0000 Subject: 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. --- src/backend/commands/async.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/backend/commands') 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; } /* -- cgit v1.2.3