OSDN Git Service

tests: clean up the temp file if test_one is interrupted
authorTheodore Ts'o <tytso@mit.edu>
Mon, 9 Jun 2014 14:47:41 +0000 (10:47 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Fri, 4 Jul 2014 20:39:49 +0000 (16:39 -0400)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
tests/test_one.in

index 01a9260..eb28313 100644 (file)
@@ -31,6 +31,7 @@ fi
 test_name=`echo $test_dir | sed -e 's;.*/;;'`
 
 TMPFILE=$(mktemp -t e2fsprogs-tmp-$test_name.XXXXXX)
+trap 'rm -f $TMPFILE ; exit' 1 2 15
 
 if [ -f $test_dir ] ; then
        exit 0;