From b75dab7a90c16f3f425f16b823a666740603fcc9 Mon Sep 17 00:00:00 2001 From: George Koehler Date: Fri, 27 Apr 2018 17:55:33 -0400 Subject: [PATCH] Skip test if sigqueue() isn't supported The value of ${.sh.sig.code} is SI_QUEUE if the system supports sigqueue(), or SI_USER otherwise. Partial fix for #483 --- src/cmd/ksh93/tests/signal.sh | 32 ++++++++++++++++++++++---------- 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/src/cmd/ksh93/tests/signal.sh b/src/cmd/ksh93/tests/signal.sh index 1d70bf0c52a7..5bc10d6da0e6 100755 --- a/src/cmd/ksh93/tests/signal.sh +++ b/src/cmd/ksh93/tests/signal.sh @@ -495,19 +495,31 @@ expect=0.5 log_error "'trap - INT' causing trap to not be ignored" "$expect" "$actual" # ==================== -# Verify ??? +# Verify kill -qN sends the value N and .sh.sig.value receives it. # compound c=(compound -a car; integer cari=0) trap 'c.car[c.cari++]=.sh.sig' USR1 kill -q4 -s USR1 $$ kill -q5 -s USR1 $$ -expect=4 -actual=${c.car[0].value.q} -(( $actual == $expect )) || - log_error "\${c.car[0].value.q} is wrong" "$expect" "$actual" - -expect=5 -actual=${c.car[1].value.q} -(( $actual == $expect )) || - log_error "\${c.car[1].value.q} is wrong" "$expect" "$actual" +case "${c.car[0].code}" in + SI_QUEUE) + # System has sigqueue(). + expect=4 + actual=${c.car[0].value.q} + (( $actual == $expect )) || + log_error "\${c.car[0].value.q} is wrong" "$expect" "$actual" + + expect=5 + actual=${c.car[1].value.q} + (( $actual == $expect )) || + log_error "\${c.car[1].value.q} is wrong" "$expect" "$actual" + ;; + SI_USER) + # System lacks sigqueue(), ksh called kill(). + log_warning "skipping test: sigqueue() not supported" + ;; + *) + log_error "expected SI_QUEUE or SI_USER, got |${c.car[0].code}|" + ;; +esac