kill $pid
}
+# Does trap support signal names?
+# Old versions of ash did not.
+require_trap_signame_()
+{
+ (trap '' CHLD) || skip_ 'requires trap with signal name support'
+}
+
+# Does kill support sending signal to whole group?
+# dash 0.5.8 at least does not.
+require_kill_group_()
+{
+ kill -0 -- -1 || skip_ 'requires kill with group signalling support'
+}
+
# Return nonzero if the specified path is on a file system for
# which FIEMAP support exists. Note some file systems (like ext3 and btrfs)
# only support FIEMAP for files, not directories.
. "${srcdir=.}/tests/init.sh"; path_prepend_ ./src
print_ver_ dd
+require_trap_signame_
-env kill -l | grep '^INFO$' && SIGINFO='INFO' || SIGINFO='USR1'
+kill -l | grep 'INFO' && SIGINFO='INFO' || SIGINFO='USR1'
# This to avoid races in the USR1 case
# as the dd process will terminate by default until
. "${srcdir=.}/tests/init.sh"; path_prepend_ ./src
print_ver_ du
+require_trap_signame_
# We use a python-inotify script, so...
python -m pyinotify -h > /dev/null \
. "${srcdir=.}/tests/init.sh"; path_prepend_ ./src
print_ver_ ginstall
+require_trap_signame_
# Use a subshell and an exec to work around a bug in FreeBSD 5.0 /bin/sh.
(
- # ash doesn't support "trap '' CHLD"; it knows only signal numbers.
- sig=$(env kill -l CHLD 2>/dev/null) && trap '' $sig
+ trap '' CHLD
# Before 2004-04-21, install would infloop, in the 'while (wait...' loop:
exec ginstall -s "$abs_top_builddir/src/ginstall$EXEEXT" .
. "${srcdir=.}/tests/init.sh"; path_prepend_ ./src
print_ver_ sort
+require_trap_signame_
seq -w 2000 > exp || framework_failure_
tac exp > in || framework_failure_
# Ensure 'sort' is immune to parent's SIGCHLD handler
# Use a subshell and an exec to work around a bug in FreeBSD 5.0 /bin/sh.
(
- # ash doesn't support "trap '' CHLD"; it knows only signal numbers.
- sig=$(env kill -l CHLD 2>/dev/null) && trap '' $sig
+ trap '' CHLD
# This should force the use of child processes for "compression"
PATH=.:$PATH exec sort -S 1k --compress-program=gzip in > /dev/null
. "${srcdir=.}/tests/init.sh"; path_prepend_ ./src
print_ver_ stty
require_controlling_input_terminal_
+require_trap_signame_
+
trap '' TTOU # Ignore SIGTTOU
# Make sure there's a tty on stdin.
require_controlling_input_terminal_
+require_trap_signame_
+
trap '' TTOU # Ignore SIGTTOU
# Get the reversible settings from stty.c.
print_ver_ stty
require_controlling_input_terminal_
+require_trap_signame_
+
trap '' TTOU # Ignore SIGTTOU
# Versions of GNU stty from shellutils-1.9.2c and earlier failed
print_ver_ stty
require_controlling_input_terminal_
+require_trap_signame_
+
trap '' TTOU # Ignore SIGTTOU
# Get the reversible settings from stty.c.
. "${srcdir=.}/tests/init.sh"; path_prepend_ ./src
print_ver_ timeout
+require_trap_signame_
+require_kill_group_
# construct a program group hierarchy as follows:
# timeout-group - foreground group
# Wait 6.3s for timeout.cmd to start
retry_delay_ check_timeout_cmd_running .1 6 || fail=1
# Simulate a Ctrl-C to the group to test timely exit
-# Note dash doesn't support signalling groups (a leading -)
-env kill -INT -- -$pid
+kill -INT -- -$pid
wait
test -e int.received || fail=1
. "${srcdir=.}/tests/init.sh"; path_prepend_ ./src
print_ver_ timeout
+require_trap_signame_
# no timeout
timeout 10 true || fail=1
# Ensure 'timeout' is immune to parent's SIGCHLD handler
# Use a subshell and an exec to work around a bug in FreeBSD 5.0 /bin/sh.
(
- # ash doesn't support "trap '' CHLD"; it knows only signal numbers.
- sig=$(env kill -l CHLD 2>/dev/null) && trap '' $sig
+ trap '' CHLD
exec timeout 10 true
) || fail=1