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
This commit is contained in:
Lennart Poettering 2007-10-29 15:33:07 +00:00
parent 27d6b7b473
commit a46804a8e2

View file

@ -336,11 +336,14 @@ int main(int argc, char *argv[]) {
*/ */
if (!getenv("LD_BIND_NOW")) { if (!getenv("LD_BIND_NOW")) {
putenv(pa_xstrdup("LD_BIND_NOW=1")); char *rp;
/* We have to execute ourselves, because the libc caches the /* We have to execute ourselves, because the libc caches the
* value of $LD_BIND_NOW on initialization. */ * 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 #endif