From f840aaa8f114e1c918da9534c446235dd6390f11 Mon Sep 17 00:00:00 2001 From: Mike Swanson Date: Sun, 28 Sep 2014 03:56:10 -0700 Subject: [PATCH] dist/freedoom: use exec to launch a port exec will terminate the script itself as well as returning the exit code from the port. --- dist/freedoom | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/dist/freedoom b/dist/freedoom index 823b0343..54cb5b03 100755 --- a/dist/freedoom +++ b/dist/freedoom @@ -39,8 +39,7 @@ if [ -z "$PORT" ] && [ -h "$HOME"/.doomport ]; then fi if [ "$PORT" ]; then - "$PORT" -iwad $IWAD "$@" - exit 0 + exec "$PORT" -iwad "$IWAD" "$@" fi dirpath=$(eval echo "\${PATH}" 2>/dev/null | tr : ' ') @@ -49,8 +48,7 @@ for port in $PORTS; do for dir in $dirpath; do for file in "$dir"/"$port"; do if [ -f "$file" ] && [ -x "$file" ]; then - "$file" -iwad $IWAD "$@" - exit 0 + exec "$file" -iwad "$IWAD" "$@" fi done done