3 # Ensure that strace does not retain stdin and stdout descriptors.
5 # Copyright (c) 2016 Dmitry V. Levin <ldv@altlinux.org>
6 # Copyright (c) 2016-2018 The strace developers.
9 # SPDX-License-Identifier: GPL-2.0-or-later
11 . "${srcdir=.}/init.sh"
13 run_prog_skip_if_failed \
22 while [ -f "$LOG" ]; do
27 if kill -0 $! 2> /dev/null; then
30 echo TIMEOUT >> "$OUT"
32 ) | $STRACE -qq -enone -esignal=none \
33 sh -c "exec <&- >&-; rm -f -- $LOG; $SLEEP_A_BIT; $SLEEP_A_BIT"
35 if [ -s "$OUT" ]; then
36 fail_ "$STRACE failed to redirect standard input"
40 $STRACE -qq -enone -esignal=none \
41 sh -c "exec <&- >&-; rm -f -- $LOG; $SLEEP_A_BIT; $SLEEP_A_BIT" |
43 while [ -f "$LOG" ]; do
48 if kill -0 $! 2> /dev/null; then
51 echo TIMEOUT >> "$OUT"
55 if [ -s "$OUT" ]; then
56 fail_ "$STRACE failed to redirect standard output"