]> git.apps.os.sepia.ceph.com Git - xfstests-dev.git/commitdiff
misc: move exit status into trap handler
authorDarrick J. Wong <djwong@kernel.org>
Mon, 21 Jun 2021 15:54:53 +0000 (08:54 -0700)
committerEryu Guan <guaneryu@gmail.com>
Sun, 27 Jun 2021 14:49:33 +0000 (22:49 +0800)
Move the "exit $status" clause of the _cleanup function into the
argument to the "trap" command so that we can standardize the
registration of the atexit cleanup code in the next few patches.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Chandan Babu R <chandanrlinux@gmail.com>
Reviewed-by: Allison Henderson <allison.henderson@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
tests/generic/068
tests/xfs/004

index 932a8560b430214e8437f3befaf7f855202c897c..573fbd4577b6c537272d9df8f735244d756b6084 100755 (executable)
@@ -22,10 +22,9 @@ _cleanup()
     cd /
 
     trap 0 1 2 3 15
-    exit $status
 }
 
-trap "_cleanup" 0 1 2 3 15
+trap "_cleanup; exit \$status" 0 1 2 3 15
 
 # get standard environment, filters and checks
 . ./common/rc
index d3fb9c958cf496bc73e131e3ed9b62347c9706e1..4d92a08eac0605c5a3297c3e09f88786dfc9f19e 100755 (executable)
@@ -18,9 +18,8 @@ _cleanup()
 {
        _scratch_unmount
        rm -f $tmp.*
-       exit $status
 }
-trap "_cleanup" 0 1 2 3 15
+trap "_cleanup; exit \$status" 0 1 2 3 15
 
 _populate_scratch()
 {