From a46804a8e2ba8aa0e869bcf72015e3b551a7b40d Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Mon, 29 Oct 2007 15:33:07 +0000 Subject: use real path of binary instead of /proc/self/exe to execute ourselves git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@1976 fefdeb5f-60dc-0310-8127-8f9354f1896f --- src/daemon/main.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/daemon/main.c b/src/daemon/main.c index 6c9f6627..cd3cfcc8 100644 --- a/src/daemon/main.c +++ b/src/daemon/main.c @@ -336,11 +336,14 @@ int main(int argc, char *argv[]) { */ if (!getenv("LD_BIND_NOW")) { - putenv(pa_xstrdup("LD_BIND_NOW=1")); + char *rp; /* We have to execute ourselves, because the libc caches the * value of $LD_BIND_NOW on initialization. */ - pa_assert_se(execv("/proc/self/exe", argv) == 0); + + putenv(pa_xstrdup("LD_BIND_NOW=1")); + pa_assert_se(rp = pa_readlink("/proc/self/exe")); + pa_assert_se(execv(rp, argv) == 0); } #endif -- cgit