Обсуждение: pgsql: Use pqsignal() in contrib programs rather than calling signal(2)

Поиск
Список
Период
Сортировка

pgsql: Use pqsignal() in contrib programs rather than calling signal(2)

От
Tom Lane
Дата:
Use pqsignal() in contrib programs rather than calling signal(2) directly.

The semantics of signal(2) are more variable than one could wish; in
particular, on strict-POSIX platforms the signal handler will be reset
to SIG_DFL when the signal is delivered.  This demonstrably breaks
pg_test_fsync's use of SIGALRM.  The other changes I made are not
absolutely necessary today, because the called handlers all exit the
program anyway.  But it seems like a good general practice to use
pqsignal() exclusively in Postgres code, now that we have it available
everywhere.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/3c07fbf40bd0276e4be02fc72cba6b1cd62da301

Modified Files
--------------
contrib/pg_standby/pg_standby.c       |    8 ++++----
contrib/pg_test_fsync/pg_test_fsync.c |    8 ++++----
2 files changed, 8 insertions(+), 8 deletions(-)