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/
diff --git a/src/tools/pginclude/headerscheck b/src/tools/pginclude/headerscheck index 6f6f0b8bda..c2053b4ccd 100755 --- a/src/tools/pginclude/headerscheck +++ b/src/tools/pginclude/headerscheck @@ -46,7 +46,7 @@ CPPFLAGS=`echo "$CPPFLAGS" | sed "s|\\\$(PG_SYSROOT)|$PG_SYSROOT|g"` # Create temp directory. tmp=`mktemp -d /tmp/$me.XXXXXX` -trap 'rm -rf $tmp' 0 1 2 3 15 +trap 'ret=$?; rm -rf $tmp && exit $ret' 0 1 2 3 15 exit_status=0