mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-10-29 05:40:23 -04:00
pulsecore: Make run-from-build not readlink() on every call
Since this is no longer only defined in debug builds, let's make sure that there is no impact if this is indavertently called repeatedly at startup.
This commit is contained in:
parent
3d7bc637c4
commit
4c23720ef1
1 changed files with 7 additions and 5 deletions
|
|
@ -3209,12 +3209,14 @@ void pa_reset_personality(void) {
|
|||
|
||||
pa_bool_t pa_run_from_build_tree(void) {
|
||||
char *rp;
|
||||
pa_bool_t b = FALSE;
|
||||
static pa_bool_t b = FALSE;
|
||||
|
||||
if ((rp = pa_readlink("/proc/self/exe"))) {
|
||||
b = pa_startswith(rp, PA_BUILDDIR);
|
||||
pa_xfree(rp);
|
||||
}
|
||||
PA_ONCE_BEGIN {
|
||||
if ((rp = pa_readlink("/proc/self/exe"))) {
|
||||
b = pa_startswith(rp, PA_BUILDDIR);
|
||||
pa_xfree(rp);
|
||||
}
|
||||
} PA_ONCE_END;
|
||||
|
||||
return b;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue