maint.mk: remove obsolete comments
[pspp] / tests / init.sh
index ee9c542c6a82b8d0a42ce1f0d9fef66e93f6bca8..512e8763846846c1182353b38023ce68e3ffe52c 100644 (file)
@@ -225,10 +225,12 @@ setup_()
     || fail_ "failed to create temporary directory in $initial_cwd_"
   cd "$test_dir_"
 
-  # This pair of trap statements ensures that the temporary directory,
-  # $test_dir_, is removed upon exit as well as upon catchable signal.
+  # These trap statements ensure that the temporary directory, $test_dir_,
+  # is removed upon exit as well as upon receipt of any of the listed signals.
   trap remove_tmp_ 0
-  trap 'Exit $?' 1 2 13 15
+  for sig_ in 1 2 3 13 15; do
+    eval "trap 'Exit $(expr $sig_ + 128)' $sig_"
+  done
 }
 
 # Create a temporary directory, much like mktemp -d does.