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@xxxxxxxxx> --- tests/generic/228 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/generic/228 b/tests/generic/228 index 121d43cc..92338982 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