From be881936f3a81e6d1a167292a997f6e18036c768 Mon Sep 17 00:00:00 2001 From: Ben Lubar Date: Sun, 9 Feb 2020 18:01:24 -0600 Subject: [PATCH] add -x (--exec) flag to run DFHack via the exec builtin this means the process run by ./dfhack will be Dwarf Fortress itself rather than the wrapper script, but it also means that no cleanup actions can occur. --- package/linux/dfhack | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/package/linux/dfhack b/package/linux/dfhack index 1bd3e8d92..b7dcdc384 100755 --- a/package/linux/dfhack +++ b/package/linux/dfhack @@ -136,6 +136,10 @@ case "$1" in strace -f setarch "$setarch_arch" -R env LD_PRELOAD="$PRELOAD_LIB" ./libs/Dwarf_Fortress "$@" 2> strace.log ret=$? ;; + -x || --exec) + exec setarch "$setarch_arch" -R env LD_PRELOAD="$PRELOAD_LIB" ./libs/Dwarf_Fortress "$@" + # script does not resume + ;; *) setarch "$setarch_arch" -R env LD_PRELOAD="$PRELOAD_LIB" ./libs/Dwarf_Fortress "$@" ret=$?