use uppercase POSIX compliant signals for the 'trap' command
In 'man 1p trap' there is written: "Implementations may permit names with the SIG prefix or ignore case in signal names as an extension." So change the lowercase signals to uppercase, which is POSIX compliant instead of being an extension. There wasn't anybody claiming that it doesn't work, but there was a bug with using a signal with the SIG prefix, which is an extension as well. So let's play it safe and change it, since it doesn't hurt anyone. While at it, also convert 8 indentation spaces to 1 tab character. Signed-off-by: Markus Heidelberg <markus.heidelberg@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Markus Heidelberg committed
Jan 20, 2009 at 00:43 UTC
35641310afa04aaa0ba5f31be6bdb2cf23ec100f
2 files changed
+10
-10
t/lib-httpd.sh
+5
-5
@@ -20,9 +20,9 @@ HTTPD_DOCUMENT_ROOT_PATH=$HTTPD_ROOT_PATH/www
20
21
if ! test -x "$LIB_HTTPD_PATH"
22
then
23
- say "skipping test, no web server found at '$LIB_HTTPD_PATH'"
24
- test_done
25
- exit
23
+ say "skipping test, no web server found at '$LIB_HTTPD_PATH'"
24
+ test_done
25
+ exit
26
fi
27
28
HTTPD_VERSION=`$LIB_HTTPD_PATH -v | \
@@ -84,7 +84,7 @@ prepare_httpd() {
84
start_httpd() {
85
prepare_httpd
86
87
- trap 'stop_httpd; die' exit
87
+ trap 'stop_httpd; die' EXIT
88
89
"$LIB_HTTPD_PATH" -d "$HTTPD_ROOT_PATH" \
90
-f "$TEST_PATH/apache.conf" $HTTPD_PARA \
@@ -92,7 +92,7 @@ start_httpd() {
92
}
93
94
stop_httpd() {
95
- trap 'die' exit
95
+ trap 'die' EXIT
96
97
"$LIB_HTTPD_PATH" -d "$HTTPD_ROOT_PATH" \
98
-f "$TEST_PATH/apache.conf" -k stop
t/test-lib.sh
+5
-5
@@ -127,7 +127,7 @@ fi
127
128
error () {
129
say_color error "error: $*"
130
- trap - exit
130
+ trap - EXIT
131
exit 1
132
}
133
@@ -163,7 +163,7 @@ die () {
163
exit 1
164
}
165
166
-trap 'die' exit
166
+trap 'die' EXIT
167
168
# The semantics of the editor variables are that of invoking
169
# sh -c "$EDITOR \"$@\"" files ...
@@ -208,7 +208,7 @@ test_failure_ () {
208
say_color error "FAIL $test_count: $1"
209
shift
210
echo "$@" | sed -e 's/^/ /'
211
- test "$immediate" = "" || { trap - exit; exit 1; }
211
+ test "$immediate" = "" || { trap - EXIT; exit 1; }
212
}
213
214
test_known_broken_ok_ () {
@@ -416,7 +416,7 @@ test_create_repo () {
416
}
417
418
test_done () {
419
- trap - exit
419
+ trap - EXIT
420
test_results_dir="$TEST_DIRECTORY/test-results"
421
mkdir -p "$test_results_dir"
422
test_results_path="$test_results_dir/${0%-*}-$$"
@@ -493,7 +493,7 @@ fi
493
test="trash directory.$(basename "$0" .sh)"
494
test ! -z "$debug" || remove_trash="$TEST_DIRECTORY/$test"
495
rm -fr "$test" || {
496
- trap - exit
496
+ trap - EXIT
497
echo >&5 "FATAL: Cannot prepare test area"
498
exit 1
499
}