diff mbox series

[v1,2/2] check: Replace exit with _exit in check

Message ID 7d8587b8342ee2cbe226fb691b372ac7df5fdb71.1745390030.git.nirjhar.roy.lists@gmail.com
State Not Applicable
Headers show
Series common: Move exit related functions to common/exit | expand

Commit Message

Nirjhar Roy (IBM) April 23, 2025, 6:41 a.m. UTC
Some of the "status=<val>;exit" and "exit <val>" were not
replace with _exit <val>. Doing it now.

Signed-off-by: Nirjhar Roy (IBM) <nirjhar.roy.lists@gmail.com>
---
 check | 39 +++++++++++++++------------------------
 1 file changed, 15 insertions(+), 24 deletions(-)
diff mbox series

Patch

diff --git a/check b/check
index 67355c52..30d44c0e 100755
--- a/check
+++ b/check
@@ -122,7 +122,7 @@  examples:
  check -X .exclude -g auto
  check -E ~/.xfstests.exclude
 '
-	    exit 1
+	    _exit 1
 }
 
 get_sub_group_list()
@@ -232,7 +232,7 @@  _prepare_test_list()
 			list=$(get_group_list $group)
 			if [ -z "$list" ]; then
 				echo "Group \"$group\" is empty or not defined?"
-				exit 1
+				_exit 1
 			fi
 
 			for t in $list; do
@@ -317,14 +317,14 @@  while [ $# -gt 0 ]; do
 	-r)
 		if $exact_order; then
 			echo "Cannot specify -r and --exact-order."
-			exit 1
+			_exit 1
 		fi
 		randomize=true
 		;;
 	--exact-order)
 		if $randomize; then
 			echo "Cannnot specify --exact-order and -r."
-			exit 1
+			_exit 1
 		fi
 		exact_order=true
 		;;
@@ -362,7 +362,7 @@  done
 # after processing args, overlay needs FSTYP set before sourcing common/config
 if ! . ./common/rc; then
 	echo "check: failed to source common/rc"
-	exit 1
+	_exit 1
 fi
 
 init_rc
@@ -374,8 +374,7 @@  if [ -n "$SOAK_DURATION" ]; then
 		sed -e 's/^\([.0-9]*\)\([a-z]\)*/\1 \2/g' | \
 		$AWK_PROG -f $here/src/soak_duration.awk)"
 	if [ $? -ne 0 ]; then
-		status=1
-		exit 1
+		_exit 1
 	fi
 fi
 
@@ -386,8 +385,7 @@  if [ -n "$FUZZ_REWRITE_DURATION" ]; then
 		sed -e 's/^\([.0-9]*\)\([a-z]\)*/\1 \2/g' | \
 		$AWK_PROG -f $here/src/soak_duration.awk)"
 	if [ $? -ne 0 ]; then
-		status=1
-		exit 1
+		_exit 1
 	fi
 fi
 
@@ -405,8 +403,7 @@  if $have_test_arg; then
 	while [ $# -gt 0 ]; do
 		case "$1" in
 		-*)	echo "Arguments before tests, please!"
-			status=1
-			exit $status
+			_exit 1
 			;;
 		*)	# Expand test pattern (e.g. xfs/???, *fs/001)
 			list=$(cd $SRC_DIR; echo $1)
@@ -439,7 +436,7 @@  fi
 if [ `id -u` -ne 0 ]
 then
     echo "check: QA must be run as root"
-    exit 1
+    _exit 1
 fi
 
 _wipe_counters()
@@ -768,8 +765,7 @@  function run_section()
 	mkdir -p $RESULT_BASE
 	if [ ! -d $RESULT_BASE ]; then
 		echo "failed to create results directory $RESULT_BASE"
-		status=1
-		exit
+		_exit 1
 	fi
 
 	if $OPTIONS_HAVE_SECTIONS; then
@@ -785,8 +781,7 @@  function run_section()
 			echo "our local _test_mkfs routine ..."
 			cat $tmp.err
 			echo "check: failed to mkfs \$TEST_DEV using specified options"
-			status=1
-			exit
+			_exit 1
 		fi
 		# Previous FSTYP derived from TEST_DEV could be changed, source
 		# common/rc again with correct FSTYP to get FSTYP specific configs,
@@ -830,8 +825,7 @@  function run_section()
 	      echo "our local _scratch_mkfs routine ..."
 	      cat $tmp.err
 	      echo "check: failed to mkfs \$SCRATCH_DEV using specified options"
-	      status=1
-	      exit
+	      _exit 1
 	  fi
 
 	  # call the overridden mount - make sure the FS mounts with
@@ -841,8 +835,7 @@  function run_section()
 	      echo "our local mount routine ..."
 	      cat $tmp.err
 	      echo "check: failed to mount \$SCRATCH_DEV using specified options"
-	      status=1
-	      exit
+	      _exit 1
 	  else
 	      _scratch_unmount
 	  fi
@@ -1105,12 +1098,10 @@  for ((iters = 0; iters < $iterations; iters++)) do
 		run_section $section
 		if [ "$sum_bad" != 0 ] && [ "$istop" = true ]; then
 			interrupt=false
-			status=`expr $sum_bad != 0`
-			exit
+			_exit `expr $sum_bad != 0`
 		fi
 	done
 done
 
 interrupt=false
-status=`expr $sum_bad != 0`
-exit
+_exit `expr $sum_bad != 0`