aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2021-12-25 06:03:29 +0000
committerEryu Guan <guaneryu@gmail.com>2021-12-25 18:52:28 +0800
commit53628c36629b0b9c2905a3599220d3f9dbc5695f (patch)
treec0d58cc161b31ab42683f9153f1c7f86aa7bbe2c
parentf375cedff940302e13940324fc0db304cbcbed64 (diff)
downloadxfstests-dev-53628c36629b0b9c2905a3599220d3f9dbc5695f.tar.gz
generic/228: set vars for early _cleanup
The `core_pattern' and `ulimit_c' variables must be set to restore their original values in case _cleanup fires early. Signed-off-by: Eric Wong <e@80x24.org> Reviewed-by: Eryu Guan <guaneryu@gmail.com> Signed-off-by: Eryu Guan <guaneryu@gmail.com>
-rwxr-xr-xtests/generic/2284
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/generic/228 b/tests/generic/228
index 121d43cc0c..92338982c8 100755
--- a/tests/generic/228
+++ b/tests/generic/228
@@ -19,6 +19,8 @@ _cleanup()
}
tmp=$TEST_DIR/$$
+core_pattern=`sysctl -n kernel.core_pattern`
+ulimit_c=`ulimit -c`
_register_cleanup "_cleanup" 25
# Import common functions.
@@ -39,8 +41,6 @@ avail=`df -P $TEST_DIR | awk 'END {print $4}'`
[ "$avail" -ge 104000 ] || _notrun "Test device is too small ($avail KiB)"
# Suppress core dumped messages
-core_pattern=`sysctl -n kernel.core_pattern`
-ulimit_c=`ulimit -c`
sysctl -w kernel.core_pattern=core &>/dev/null
ulimit -c 0