{"thread":{"id":"17262","subject":"[PATCH] use uppercase POSIX compliant signals for the 'trap' command","startedAt":"2009-01-19T23:43:26Z","lastAt":"2009-01-19T23:43:26Z","messageCount":1,"participants":["Markus Heidelberg"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"101186","messageId":"200901200043.26209.markus.heidelberg@web.de","threadId":"17262","inReplyTo":null,"subject":"[PATCH] use uppercase POSIX compliant signals for the 'trap' command","fromName":"Markus Heidelberg","fromEmail":"markus.heidelberg@web.de","sentAt":"2009-01-19T23:43:26Z","receivedAt":"2009-01-19T23:43:26Z","isPatch":true,"sender":{"key":"markus.heidelberg@web.de","avatar":"https://avatars.githubusercontent.com/u/6334512?v=4"},"body":"In 'man 1p trap' there is written:\n\n    \"Implementations may permit names with the SIG prefix or ignore case\n    in signal names as an extension.\"\n\nSo change the lowercase signals to uppercase, which is POSIX compliant\ninstead of being an extension.\n\nThere wasn't anybody claiming that it doesn't work, but there was a bug\nwith using a signal with the SIG prefix, which is an extension as well.\nSo let's play it safe and change it, since it doesn't hurt anyone.\n\nWhile at it, also convert 8 indentation spaces to 1 tab character.\n\nSigned-off-by: Markus Heidelberg <markus.heidelberg@web.de>\n---\n t/lib-httpd.sh |   10 +++++-----\n t/test-lib.sh  |   10 +++++-----\n 2 files changed, 10 insertions(+), 10 deletions(-)\n\ndiff --git a/t/lib-httpd.sh b/t/lib-httpd.sh\nindex 6ac312b..3824020 100644\n--- a/t/lib-httpd.sh\n+++ b/t/lib-httpd.sh\n@@ -20,9 +20,9 @@ HTTPD_DOCUMENT_ROOT_PATH=$HTTPD_ROOT_PATH/www\n \n if ! test -x \"$LIB_HTTPD_PATH\"\n then\n-        say \"skipping test, no web server found at '$LIB_HTTPD_PATH'\"\n-        test_done\n-        exit\n+\tsay \"skipping test, no web server found at '$LIB_HTTPD_PATH'\"\n+\ttest_done\n+\texit\n fi\n \n HTTPD_VERSION=`$LIB_HTTPD_PATH -v | \\\n@@ -84,7 +84,7 @@ prepare_httpd() {\n start_httpd() {\n \tprepare_httpd\n \n-\ttrap 'stop_httpd; die' exit\n+\ttrap 'stop_httpd; die' EXIT\n \n \t\"$LIB_HTTPD_PATH\" -d \"$HTTPD_ROOT_PATH\" \\\n \t\t-f \"$TEST_PATH/apache.conf\" $HTTPD_PARA \\\n@@ -92,7 +92,7 @@ start_httpd() {\n }\n \n stop_httpd() {\n-\ttrap 'die' exit\n+\ttrap 'die' EXIT\n \n \t\"$LIB_HTTPD_PATH\" -d \"$HTTPD_ROOT_PATH\" \\\n \t\t-f \"$TEST_PATH/apache.conf\" -k stop\ndiff --git a/t/test-lib.sh b/t/test-lib.sh\nindex 22ed448..41d5a59 100644\n--- a/t/test-lib.sh\n+++ b/t/test-lib.sh\n@@ -127,7 +127,7 @@ fi\n \n error () {\n \tsay_color error \"error: $*\"\n-\ttrap - exit\n+\ttrap - EXIT\n \texit 1\n }\n \n@@ -163,7 +163,7 @@ die () {\n \texit 1\n }\n \n-trap 'die' exit\n+trap 'die' EXIT\n \n # The semantics of the editor variables are that of invoking\n # sh -c \"$EDITOR \\\"$@\\\"\" files ...\n@@ -208,7 +208,7 @@ test_failure_ () {\n \tsay_color error \"FAIL $test_count: $1\"\n \tshift\n \techo \"$@\" | sed -e 's/^/\t/'\n-\ttest \"$immediate\" = \"\" || { trap - exit; exit 1; }\n+\ttest \"$immediate\" = \"\" || { trap - EXIT; exit 1; }\n }\n \n test_known_broken_ok_ () {\n@@ -416,7 +416,7 @@ test_create_repo () {\n }\n \n test_done () {\n-\ttrap - exit\n+\ttrap - EXIT\n \ttest_results_dir=\"$TEST_DIRECTORY/test-results\"\n \tmkdir -p \"$test_results_dir\"\n \ttest_results_path=\"$test_results_dir/${0%-*}-$$\"\n@@ -493,7 +493,7 @@ fi\n test=\"trash directory.$(basename \"$0\" .sh)\"\n test ! -z \"$debug\" || remove_trash=\"$TEST_DIRECTORY/$test\"\n rm -fr \"$test\" || {\n-\ttrap - exit\n+\ttrap - EXIT\n \techo >&5 \"FATAL: Cannot prepare test area\"\n \texit 1\n }\n-- \n1.6.1.216.g3acd\n"}]}