chiark / gitweb /
Better cleanup in t-watch.
authorRichard Kettlewell <rjk@greenend.org.uk>
Sat, 5 Mar 2011 09:26:54 +0000 (09:26 +0000)
committerRichard Kettlewell <rjk@greenend.org.uk>
Sat, 5 Mar 2011 09:26:54 +0000 (09:26 +0000)
tests/t-watch

index 922a0ad..3b4e21b 100755 (executable)
 set -e
 export PATH=".:tests:${PATH}"
 
-rm -f WatchMe
+rm -f WatchMe watch-results
 
 watchfile WatchMe > watch-results &
 pid=$!
 
+trap "kill ${pid} >/dev/null 2>&1" EXIT INT HUP TERM
+
 sleep 1                         # allow watchfile to start up
 
 echo one > WatchMe