11#! /bin/sh
2- # $PostgreSQL: pgsql/src/test/regress/pg_regress.sh,v 1.50 2004/11/17 18:06:04 tgl Exp $
2+ # $PostgreSQL: pgsql/src/test/regress/pg_regress.sh,v 1.51 2004/12/12 15:34:15 petere Exp $
33
44me=` basename$0 `
55: ${TMPDIR=/ tmp}
@@ -238,18 +238,20 @@ PGDATESTYLE='ISO, MDY'; export PGDATESTYLE
238238# with the result of the last shell command before the `exit'. Hence
239239# we have to write `(exit x); exit' below this point.
240240
241- trap '
242- savestatus=$?
241+ exit_trap (){
242+ savestatus=$1
243243if [-n " $postmaster_pid " ]; then
244244kill -2" $postmaster_pid "
245245wait " $postmaster_pid "
246246unset postmaster_pid
247247fi
248248 rm -f" $TMPFILE " && exit $savestatus
249- ' 0
249+ }
250+
251+ trap ' exit_trap $?' 0
250252
251- trap '
252- savestatus=$?
253+ sig_trap () {
254+ savestatus=$1
253255echo ; echo " caught signal"
254256if [-n " $postmaster_pid " ]; then
255257echo " signalling fast shutdown to postmaster with pid$postmaster_pid "
@@ -258,7 +260,9 @@ trap '
258260unset postmaster_pid
259261fi
260262 (exit$savestatus ); exit
261- ' 1 2 13 15
263+ }
264+
265+ trap ' sig_trap $?' 1 2 13 15
262266
263267
264268