Skip to content

Commit

Permalink
Make stumpish work on OpenBSD again
Browse files Browse the repository at this point in the history
This fixes regression which was introduced by
stumpwm#296
  • Loading branch information
catap committed Nov 29, 2024
1 parent 7f0bc88 commit 63b62c6
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions util/stumpish/stumpish
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,25 @@ stumpwm_pid ()
echo "a bug in stumpish, please report it." 1>&2
echo 1>&2
exit 1
elif [ "$(cat /proc/${pid}/comm)" = "stumpwm" ]
elif [ -e "/proc/${pid}/comm" -a "$(cat /proc/${pid}/comm 2>/dev/null)" = "stumpwm" ]
then
STUMPWM_PID=$pid
break
else
elif [ -n "$(which pgrep 2>/dev/null)" ]
then
pid=$(pgrep stumpwm)
if [ -n $pid ]
then
STUMPWM_PID=$pid
break
else
pid=1
fi
elif [ -e /proc/$pid/stat ]
then
pid=$(cut -f 4 -d " " < /proc/$pid/stat)
else
pid=1
fi
done
}
Expand Down

0 comments on commit 63b62c6

Please sign in to comment.