test: reindent, don't warn on PID 0

PID 0 for a collected task is not a bug, 1 or < 0 is a bug.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg committed 2023-09-16 10:28:48 +02:00
1 parent 11946f12d3
commit efed0db16b
1 file changed
+2 -1
+2 -1
View File
@@ -2,7 +2,6 @@
nm=$1 nm=$1
# shellcheck disable=SC2046
getpid() getpid()
{ {
initctl status "$1" |awk '/PID :/{ print $3; }' initctl status "$1" |awk '/PID :/{ print $3; }'
@@ -38,11 +37,13 @@ while [ "$pid" -le 1 ]; do
continue continue
fi fi
if [ $pid -ne 0 ]; then
echo "Got a bad PID: $pid, aborting ..." echo "Got a bad PID: $pid, aborting ..."
ps ps
sleep 1 sleep 1
initctl status "$nm" initctl status "$nm"
ps ps
fi
exit 1 exit 1
fi fi
break break