fix: handle the case where parent PID is 0

This happens inside an LXD VM.

Closes #7082
This commit is contained in:
andreby committed 2024-08-28 06:34:42 +02:00
1 parent 8e2b4dc688
commit 86cadfd43e
1 file changed
+1 -1
+1 -1
View File
@@ -20,7 +20,7 @@ ps_backtrace() {
fi fi
ppid=$(ps -o ppid= $pid) ppid=$(ps -o ppid= $pid)
ps uww $header_modifier -p $pid ps uww $header_modifier -p $pid
if [ $pid -eq 1 ]; then if [ $pid -eq 1 -o $pid -eq 0 ]; then
break break
fi fi
pid=$ppid pid=$ppid