mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-02 09:01:46 -05:00
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>
This commit is contained in:
parent
eca6217129
commit
8a4a4f408c
1 changed files with 2 additions and 2 deletions
|
|
@ -193,10 +193,10 @@ char *pa_get_binary_name(char *s, size_t l) {
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __linux__
|
#if defined(__linux__) || defined(__FreeBSD_kernel__)
|
||||||
{
|
{
|
||||||
char *rp;
|
char *rp;
|
||||||
/* This works on Linux only */
|
/* This works on Linux and Debian/kFreeBSD */
|
||||||
|
|
||||||
if ((rp = pa_readlink("/proc/self/exe"))) {
|
if ((rp = pa_readlink("/proc/self/exe"))) {
|
||||||
pa_strlcpy(s, pa_path_get_filename(rp), l);
|
pa_strlcpy(s, pa_path_get_filename(rp), l);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue