aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorPeter Holm <pho@FreeBSD.org>2021-07-05 07:14:05 +0000
committerPeter Holm <pho@FreeBSD.org>2021-07-05 07:14:05 +0000
commit7ebe83ddb788568181aa0916b23284cdce639b3c (patch)
treecb5bfee705c5054856b9c7f8fc166b1eb143b87b /tools
parent167897510919a76740eca0d79713abbd088660fe (diff)
downloadsrc-7ebe83ddb788568181aa0916b23284cdce639b3c.tar.gz
src-7ebe83ddb788568181aa0916b23284cdce639b3c.zip
stress2: Limit scope of rm(1) wildcard in cleanup.
Reviewed by: rgrimes
Diffstat (limited to 'tools')
-rwxr-xr-xtools/test/stress2/misc/mmap3.sh5
1 files changed, 3 insertions, 2 deletions
diff --git a/tools/test/stress2/misc/mmap3.sh b/tools/test/stress2/misc/mmap3.sh
index 9175b77842f3..8a319377070f 100755
--- a/tools/test/stress2/misc/mmap3.sh
+++ b/tools/test/stress2/misc/mmap3.sh
@@ -42,12 +42,13 @@ while [ `date '+%s'` -lt $((start + 5 * 60)) ]; do
./mmap3
done
echo "Expect Segmentation faults"
-trap "rm -f /tmp/mmap3.0*" EXIT INT
+trap "ls /tmp/mmap3* | grep -E 'mmap3\.[0-9]{6}\.[0-9]{4}$' | xargs rm -v" \
+ EXIT INT
start=`date '+%s'`
while [ `date '+%s'` -lt $((start + 5 * 60)) ]; do
./mmap3 random
done
-rm -f mmap3 mmap3.core /tmp/mmap3.0*
+rm -f mmap3 mmap3.core
exit
EOF