wrong shell trap

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема wrong shell trap
Дата
Msg-id 20220913181002.hzsosy7qkemb7ky7@alvherre.pgsql
обсуждение исходный текст
Ответы Re: wrong shell trap  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
While messing with the new guc.h stuff I happened run headerscheck and
wanted to abort it right away, and in doing so I realized that its
'trap' line is incorrect: it only removes its temp dir, but it doesn't
exit the program; so after you C-c it, it will spew a ton of complaints
about its temp dir not existing.

AFAICT almost all of our shell scripts contain the same mistake.  I
propose to fix them all as in the attached demo patch, which makes
headerscheck exit properly (no silly noise) when interrupted.

(I confess to not fully understanding why every other trap does
"rm && exit $ret" rather than "rm ; exit", but I guess rm -fr should not
fail anyway thus this should OK.)

-- 
Álvaro Herrera        Breisgau, Deutschland  —  https://www.EnterpriseDB.com/

Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Peter Geoghegan
Дата:
Сообщение: Re: New strategies for freezing, advancing relfrozenxid early
Следующее
От: Nathan Bossart
Дата:
Сообщение: Re: postgres_fdw hint messages