Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 3d53b9e

Browse files
committed
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
1 parent 152c9f7 commit 3d53b9e

File tree

5 files changed

+7
-7
lines changed

5 files changed

+7
-7
lines changed

src/tools/find_static

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# src/tools/find_static
44

5-
trap "rm -f /tmp/$$" 0 1 2 3 15
5+
trap "ret=$?; rm -rf /tmp/$$; exit $ret" 0 1 2 3 15
66

77
# This script finds functions that are either never called, or
88
# should be static.

src/tools/make_ctags

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
command -v ctags >/dev/null || \
66
{ echo "'ctags' program not found" 1>&2; exit 1; }
77

8-
trap "rm -f /tmp/$$" 0 1 2 3 15
8+
trap "ret=$?; rm -rf /tmp/$$; exit $ret" 0 1 2 3 15
99
rm -f ./tags
1010

1111
IS_EXUBERANT=""

src/tools/pginclude/cpluspluscheck

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ done
5050
# Create temp directory.
5151
tmp=`mktemp -d /tmp/$me.XXXXXX`
5252

53-
trap 'rm -rf $tmp' 0 1 2 3 15
53+
trap "ret=$?; rm -rf $tmp; exit $ret" 0 1 2 3 15
5454

5555
exit_status=0
5656

src/tools/pginclude/headerscheck

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ CPPFLAGS=`echo "$CPPFLAGS" | sed "s|\\\$(PG_SYSROOT)|$PG_SYSROOT|g"`
4646
# Create temp directory.
4747
tmp=`mktemp -d /tmp/$me.XXXXXX`
4848

49-
trap 'rm -rf $tmp' 0 1 2 3 15
49+
trap "ret=$?; rm -rf $tmp; exit $ret" 0 1 2 3 15
5050

5151
exit_status=0
5252

@@ -154,9 +154,9 @@ do
154154
EXTRAINCLUDES="$python_includespec" ;;
155155
src/interfaces/ecpg/*)
156156
EXTRAINCLUDES="-I $builddir/src/interfaces/ecpg/include -I $srcdir/src/interfaces/ecpg/include" ;;
157-
src/backend/parser/*)
157+
src/backend/parser/*)
158158
EXTRAINCLUDES="-I $builddir/src/backend/parser/" ;;
159-
src/backend/utils/adt/*)
159+
src/backend/utils/adt/*)
160160
EXTRAINCLUDES="-I $builddir/src/backend/utils/adt/" ;;
161161
*)
162162
EXTRAINCLUDES="" ;;

src/tools/pgtest

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ MAKE="make"
1414

1515
[ ! -d src ] && echo "This must be run from the top of the PostgreSQL source tree" 1>&2 && exit 1
1616

17-
trap "rm -rf /tmp/$$" 0 1 2 3 15
17+
trap "ret=$?; rm -rf /tmp/$$; exit $ret" 0 1 2 3 15
1818
mkdir /tmp/$$
1919
TMP="/tmp/$$"
2020

0 commit comments

Comments
 (0)