Ensure that 'errno' is saved and restored by all signal handlers that
Tom Lane <tgl@sss.pgh.pa.us>
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.
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/commands/async.c | modified | +4 −1 |
| src/backend/postmaster/postmaster.c | modified | +50 −7 |
| src/backend/storage/lmgr/proc.c | modified | +10 −4 |
| src/backend/tcop/postgres.c | modified | +5 −2 |
| src/bin/psql/common.c | modified | +4 −1 |
| src/interfaces/libpq/fe-connect.c | modified | +6 −1 |