lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Tue, 18 Jun 2024 11:06:41 +0200
From: Petr Vorel <pvorel@...e.cz>
To: linux-kernel@...r.kernel.org
Cc: Petr Vorel <pvorel@...e.cz>,
	Randy Dunlap <rdunlap@...radead.org>,
	Thorsten Leemhuis <linux@...mhuis.info>,
	Jonathan Corbet <corbet@....net>,
	Jiri Olsa <jolsa@...nel.org>,
	Shuah Khan <skhan@...uxfoundation.org>,
	linux-kselftest@...r.kernel.org
Subject: [PATCH 2/2] tools: build: Fix bashisms in run.sh

Fix bashisms:

* exit -1 converted to 255 (exit|return with negative status code is not
  supported on some shells)
* 'function' is useless

This fixes problems on dash, busybox ash or any other strictly POSIX
compatible shell.

Fixes: c819e2cf2eb6f ("tools build: Add new build support")
Signed-off-by: Petr Vorel <pvorel@...e.cz>
---
 tools/build/tests/run.sh | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/tools/build/tests/run.sh b/tools/build/tests/run.sh
index 2c54e4d435464..87d6cad57b20c 100755
--- a/tools/build/tests/run.sh
+++ b/tools/build/tests/run.sh
@@ -1,20 +1,20 @@
 #!/bin/sh
 # SPDX-License-Identifier: GPL-2.0
 
-function test_ex {
+test_ex() {
 	make -C ex V=1 clean > ex.out 2>&1
 	make -C ex V=1 >> ex.out 2>&1
 
 	if [ ! -x ./ex/ex ]; then
 	  echo FAILED
-	  exit -1
+	  exit 255
 	fi
 
 	make -C ex V=1 clean > /dev/null 2>&1
 	rm -f ex.out
 }
 
-function test_ex_suffix {
+test_ex_suffix() {
 	make -C ex V=1 clean > ex.out 2>&1
 
 	# use -rR to disable make's builtin rules
@@ -24,19 +24,19 @@ function test_ex_suffix {
 
 	if [ -x ./ex/ex ]; then
 	  echo FAILED
-	  exit -1
+	  exit 255
 	fi
 
 	if [ ! -f ./ex/ex.o -o ! -f ./ex/ex.i -o ! -f ./ex/ex.s ]; then
 	  echo FAILED
-	  exit -1
+	  exit 255
 	fi
 
 	make -C ex V=1 clean > /dev/null 2>&1
 	rm -f ex.out
 }
 
-function test_ex_include {
+test_ex_include() {
 	make -C ex V=1 clean > ex.out 2>&1
 
 	# build with krava.h include
@@ -45,7 +45,7 @@ function test_ex_include {
 
 	if [ ! -x ./ex/ex ]; then
 	  echo FAILED
-	  exit -1
+	  exit 255
 	fi
 
 	# build without the include
@@ -54,7 +54,7 @@ function test_ex_include {
 
 	if [ ! -x ./ex/ex ]; then
 	  echo FAILED
-	  exit -1
+	  exit 255
 	fi
 
 	make -C ex V=1 clean > /dev/null 2>&1
-- 
2.45.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ