scc

simple c99 compiler
git clone git://git.simple-cc.org/scc
Log | Files | Refs | Submodules | README | LICENSE

commit de915f2ce6df2d9bf9006ef6aa318bf252aa99ef
parent b2d141b26dec9b355c67e319f8771b07cf2d99aa
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Fri, 10 Jan 2025 13:14:18 +0100

tests/make: Kill the timer proc

Don't let it to print timeout later or even worse
to kill an inocent process.

Diffstat:
Mtests/make/execute/0098-signal.sh | 6+++---
Mtests/make/execute/0099-signal.sh | 6+++---
Mtests/make/execute/0100-signal.sh | 6+++---
Mtests/make/execute/0101-signal.sh | 6+++---
Mtests/make/execute/0102-signal.sh | 6+++---
5 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/tests/make/execute/0098-signal.sh b/tests/make/execute/0098-signal.sh @@ -19,17 +19,17 @@ file.txt: @touch $@ @while : ; do sleep 1 ; done EOF - pid=$! sleep 10 && echo timeout >&2 && kill $$ 2>/dev/null & +timer=$! while : do if test -f file.txt then - kill $pid 2>/dev/null - wait $pid + kill $pid $timer 2>/dev/null + wait $pid $timer break fi done diff --git a/tests/make/execute/0099-signal.sh b/tests/make/execute/0099-signal.sh @@ -19,17 +19,17 @@ test.txt: @+touch $@ +@while : ; do sleep 1 ; done EOF - pid=$! sleep 10 && echo timeout >&2 && kill $$ 2>/dev/null & +timer=$! while : do if test -f test.txt then - kill $pid 2>/dev/null - wait $pid + kill $pid $timer 2>/dev/null + wait $pid $timer break fi done diff --git a/tests/make/execute/0100-signal.sh b/tests/make/execute/0100-signal.sh @@ -21,17 +21,17 @@ test.txt: @touch $@ @while : ; do sleep 1 ; done EOF - pid=$! sleep 10 && echo timeout >&2 && kill $$ 2>/dev/null & +timer=$! while : do if test -f test.txt then - kill $pid 2>/dev/null - wait $pid + kill $pid $timer 2>/dev/null + wait $pid $timer break fi done diff --git a/tests/make/execute/0101-signal.sh b/tests/make/execute/0101-signal.sh @@ -19,17 +19,17 @@ test.txt: @+touch $@ +@while : ; do sleep 1 ; done EOF - pid=$! sleep 10 && echo timeout >&2 && kill $$ 2>/dev/null & +timer=$! while : do if test -f test.txt then - kill $pid 2>/dev/null - wait $pid + kill $pid $timer 2>/dev/null + wait $pid $timer break fi done diff --git a/tests/make/execute/0102-signal.sh b/tests/make/execute/0102-signal.sh @@ -19,17 +19,17 @@ adir: @mkdir $@ @while : ; do sleep 1 ; done EOF - pid=$! sleep 10 && echo timeout >&2 && kill $$ 2>/dev/null & +timer=$! while : do if test -d adir then - kill $pid 2>/dev/null - wait $pid + kill $pid $timer 2>/dev/null + wait $pid $timer break fi done