From 319cdf4ff3e53858cf0c03c3fe965ee56d94e895 Mon Sep 17 00:00:00 2001 From: Chris Frey Date: Sat, 11 Dec 2021 20:55:03 -0500 Subject: Meta: Do not ignore error message with exec When calling sub-programs from shell with exec, the useful || die idiom does not actually do anything, since the first script is gone. --- Meta/build-image-qemu.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'Meta/build-image-qemu.sh') diff --git a/Meta/build-image-qemu.sh b/Meta/build-image-qemu.sh index 958c0eadf5..10114ba397 100755 --- a/Meta/build-image-qemu.sh +++ b/Meta/build-image-qemu.sh @@ -8,7 +8,8 @@ die() { } if [ "$(id -u)" != 0 ]; then - exec sudo -E -- "$0" "$@" || die "this script needs to run as root" + sudo -E -- "$0" "$@" || die "this script needs to run as root" + exit 0 else : "${SUDO_UID:=0}" "${SUDO_GID:=0}" fi -- cgit v1.2.3