summaryrefslogtreecommitdiffstats
path: root/src/daemon/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/daemon/main.c')
-rw-r--r--src/daemon/main.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/src/daemon/main.c b/src/daemon/main.c
index 9e5647a8..576fc3e6 100644
--- a/src/daemon/main.c
+++ b/src/daemon/main.c
@@ -425,21 +425,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