Play Windows games on Apple Silicon Macs. Free, open-source app that installs the official Battle.net, Steam, Epic and GOG launchers and lists your games in one library.
HTML apple-siliconbattle-netcrossover-alternatived3dmetaldiablo-ii-resurrecteddxmtea-appepic-gamesgame-porting-toolkitgogmac-gamingmacosmacos-gamingrockstar-gamessteamubisoft-connectwhisky-alternativewindows-gameswinewine-wrapper
reaper: a failed server query is not a missing server
mikey928331c058210d
diff --git a/scripts/soju-reaper.sh b/scripts/soju-reaper.shindex 16d49d5fc38..b11389eb73b 100755--- a/scripts/soju-reaper.sh+++ b/scripts/soju-reaper.sh@@ -79,12 +79,17 @@ esacSERVER_DIR="$(/usr/bin/stat -f "/tmp/.wine-$(id -u)/server-%Xd-%Xi" "$PREFIX" 2>/dev/null || true)"SERVER_DIR_REAL="$(cd /tmp 2>/dev/null && pwd -P)${SERVER_DIR#/tmp}"+# Returns 0 alive, 1 gone, 2 unknown (the query itself failed: every+# wineserver has a cwd, so no output at all means lsof did not answer, and+# the caller must skip the round rather than count an orphan strike).server_alive() {- local pids+ local pids out[ -n "$SERVER_DIR" ] || return 0 # cannot tell, assume it is therepids=$(pgrep -x wineserver 2>/dev/null | tr '\n' ',' | sed 's/,$//')[ -n "$pids" ] || return 1- lsof -a -p "$pids" -d cwd -Fn 2>/dev/null | grep -qxF -e "n$SERVER_DIR" -e "n$SERVER_DIR_REAL"+ out=$(lsof -a -p "$pids" -d cwd -Fn 2>/dev/null)+ [ -n "$out" ] || return 2+ printf '%s\n' "$out" | grep -qxF -e "n$SERVER_DIR" -e "n$SERVER_DIR_REAL"}# PIDs of this bottle's Wine processes (the server itself excluded): every one@@ -200,7 +205,9 @@ ORPHAN_STRIKES=0while true; dosleep "$INTERVAL"- if ! server_alive; then+ server_alive; alive=$?+ [ "$alive" -ne 2 ] || continue # query failed: not evidence of anything+ if [ "$alive" -ne 0 ]; thenORPHAN_STRIKES=$((ORPHAN_STRIKES + 1))if [ "$ORPHAN_STRIKES" -ge 2 ]; then reap_orphans; exit 0; ficontinue