diff mbox series

[libgpiod,v2,6/8] tools: tests: check exit code directly

Message ID 20240603115628.102616-7-warthog618@gmail.com
State New
Headers show
Series tools: tests: fix shellcheck warnings | expand

Commit Message

Kent Gibson June 3, 2024, 11:56 a.m. UTC
Fix shellcheck SC2181[1] - check exit code directly.

[1] https://www.shellcheck.net/wiki/SC2181

Signed-off-by: Kent Gibson <warthog618@gmail.com>
---
 tools/gpio-tools-test.bash | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/tools/gpio-tools-test.bash b/tools/gpio-tools-test.bash
index d9930f1..83b05ec 100755
--- a/tools/gpio-tools-test.bash
+++ b/tools/gpio-tools-test.bash
@@ -3069,8 +3069,7 @@  check_kernel() {
 check_prog() {
 	local PROG=$1
 
-	which "$PROG" > /dev/null
-	if [ "$?" -ne "0" ]
+	if ! which "$PROG" > /dev/null
 	then
 		die "$PROG not found - needed to run the tests"
 	fi