summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Meerwald <pmeerw@pmeerw.net>2014-08-04 14:45:23 +0200
committerPeter Meerwald <pmeerw@pmeerw.net>2014-08-12 22:13:23 +0200
commit8a4a4f408c3e71a67b2134c21b971ce54a571fd1 (patch)
tree5ddf2ece3fd57b77dbad349462d555d4dd8ce4c0
parenteca6217129e835e1beabd13e7ca839ef0f89ddd0 (diff)
util: Fix pa_get_binary_name() on Debian/kFreeBSD
Debian GNU/kFreeBSD uses a FreeBSD kernel and GLIBC, it #defines __FreeBSD_kernel__, but not __FreeBSD__ nor __linux__ Debian GNU/kFreeBSD does have a /proc/self/exe FreeBSD #defines __FreeBSD__ and __FreeBSD_kernel__ problem reporte here: http://lists.freedesktop.org/archives/pulseaudio-discuss/2014-July/020998.html http://stackoverflow.com/questions/1023306/finding-current-executables-path-without-proc-self-exe and http://stackoverflow.com/questions/933850/how-to-find-the-location-of-the-executable-in-c have some background info Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
-rw-r--r--src/pulse/util.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/pulse/util.c b/src/pulse/util.c
index 50f90b85b..ace698c03 100644
--- a/src/pulse/util.c
+++ b/src/pulse/util.c
@@ -193,10 +193,10 @@ char *pa_get_binary_name(char *s, size_t l) {
}
#endif
-#ifdef __linux__
+#if defined(__linux__) || defined(__FreeBSD_kernel__)
{
char *rp;
- /* This works on Linux only */
+ /* This works on Linux and Debian/kFreeBSD */
if ((rp = pa_readlink("/proc/self/exe"))) {
pa_strlcpy(s, pa_path_get_filename(rp), l);