diff --git a/maintainers/scripts/dep-licenses.sh b/maintainers/scripts/dep-licenses.sh index 28ad22c334fc..816dcf6d7f76 100755 --- a/maintainers/scripts/dep-licenses.sh +++ b/maintainers/scripts/dep-licenses.sh @@ -9,7 +9,7 @@ tmp=$(mktemp --tmpdir -d nixpkgs-dep-license.XXXXXX) exitHandler() { exitCode=$? rm -rf "$tmp" - exit $exitCode + return $exitCode } trap "exitHandler" EXIT diff --git a/pkgs/stdenv/generic/setup.sh b/pkgs/stdenv/generic/setup.sh index 0777fa830c10..350fff482528 100644 --- a/pkgs/stdenv/generic/setup.sh +++ b/pkgs/stdenv/generic/setup.sh @@ -143,14 +143,14 @@ exitHandler() { echo "build failed with exit code $exitCode (ignored)" mkdir -p "$out/nix-support" printf "%s" "$exitCode" > "$out/nix-support/failed" - exit 0 + return 0 fi else runHook exitHook fi - exit "$exitCode" + return "$exitCode" } trap "exitHandler" EXIT