Don't override LD_PRELOAD value if already set

This commit is contained in:
Achmad Chun Chun 2024-02-14 20:06:12 +07:00
parent 9b343c2879
commit 600fb54f21
1 changed files with 1 additions and 1 deletions

View File

@ -1,7 +1,7 @@
#!/bin/bash -e
# Enable jemalloc for reduced memory usage and latency.
if [ -f /usr/lib/*/libjemalloc.so.2 ]; then
if [ -z "${LD_PRELOAD+x}" ] && [ -f /usr/lib/*/libjemalloc.so.2 ]; then
export LD_PRELOAD="$(echo /usr/lib/*/libjemalloc.so.2) $LD_PRELOAD"
fi