Skip to content

Commit f72c911

Browse files
fix: attempt to fix env path
1 parent 86a4373 commit f72c911

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

udroid/src/udroid.sh

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -445,21 +445,23 @@ login() {
445445
fi
446446
fi
447447

448+
# set LD_PRELOAD to libandroid-shmem.a
449+
if ! $no_android_shmem; then
450+
shmem_lib_path="${root_fs_path}/lib/libandroid-shmem.a"
451+
if [ -f "$shmem_lib_path" ]; then
452+
_ld="$shmem_lib_path"
453+
else
454+
_ld=""
455+
fi
456+
fi
448457
# set basic environment variables
449458
set -- "/usr/bin/env" "-i" \
450459
"HOME=/root" \
451460
"LANG=C.UTF-8" \
452461
"TERM=${TERM-xterm-256color}" \
462+
"LD_PRELOAD=$_ld" \
453463
"$@"
454464

455-
# set LD_PRELOAD to libandroid-shmem.a
456-
if ! $no_android_shmem; then
457-
shmem_lib_path="${root_fs_path}/lib/libandroid-shmem.a"
458-
[[ -f "$shmem_lib_path" ]] && {
459-
set -- "LD_PRELOAD=$shmem_lib_path" "$@"
460-
}
461-
fi
462-
463465
# set --rootfs
464466
set -- "--rootfs=${root_fs_path}" "$@"
465467

0 commit comments

Comments
 (0)