diff options
Diffstat (limited to 'src/daemon/main.c')
-rw-r--r-- | src/daemon/main.c | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/src/daemon/main.c b/src/daemon/main.c index 2e16c187..c006badb 100644 --- a/src/daemon/main.c +++ b/src/daemon/main.c @@ -423,21 +423,24 @@ int main(int argc, char *argv[]) { pa_set_env("LD_BIND_NOW", "1"); - canonical_rp = pa_realpath(PA_BINARY); + if ((canonical_rp = pa_realpath(PA_BINARY))) { - if ((rp = pa_readlink("/proc/self/exe"))) { + if ((rp = pa_readlink("/proc/self/exe"))) { - if (pa_streq(rp, canonical_rp)) - pa_assert_se(execv(rp, argv) == 0); - else - pa_log_warn("/proc/self/exe does not point to %s, cannot self execute. Are you playing games?", canonical_rp); + if (pa_streq(rp, canonical_rp)) + pa_assert_se(execv(rp, argv) == 0); + else + pa_log_warn("/proc/self/exe does not point to %s, cannot self execute. Are you playing games?", canonical_rp); - pa_xfree(rp); + pa_xfree(rp); - } else - pa_log_warn("Couldn't read /proc/self/exe, cannot self execute. Running in a chroot()?"); + } else + pa_log_warn("Couldn't read /proc/self/exe, cannot self execute. Running in a chroot()?"); + + pa_xfree(canonical_rp); - pa_xfree(canonical_rp); + } else + pa_log_warn("Couldn't canonicalize binary path, cannot self execute."); } #endif @@ -748,6 +751,8 @@ int main(int argc, char *argv[]) { pa_log_debug(_("Running in valgrind mode: %s"), pa_yes_no(pa_in_valgrind())); + pa_log_debug(_("Running in VM: %s"), pa_yes_no(pa_running_in_vm())); + #ifdef __OPTIMIZE__ pa_log_debug(_("Optimized build: yes")); #else |