From 3d53b9ef1a4cda7b6303a0496f8531eceeef0e77 Mon Sep 17 00:00:00 2001 From: Alvaro Herrera Date: Tue, 20 Sep 2022 18:50:16 +0200 Subject: Fix `trap` in a few shell scripts The original `trap` lines in these scripts are incomplete: in case of any signal, they delete the working directory but let the script run to completion, which is useless because it will only proceed to complain about the working directory being removed. Add `exit` there, with the original exit value (not rm's). Since this is mostly just cosmetic, no backpatch. Discussion: https://postgr.es/m/20220913181002.hzsosy7qkemb7ky7@alvherre.pgsql --- src/tools/pginclude/cpluspluscheck | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/tools/pginclude/cpluspluscheck') diff --git a/src/tools/pginclude/cpluspluscheck b/src/tools/pginclude/cpluspluscheck index bffca18890c..b393f2a2eaa 100755 --- a/src/tools/pginclude/cpluspluscheck +++ b/src/tools/pginclude/cpluspluscheck @@ -50,7 +50,7 @@ done # 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 -- cgit v1.2.3