[pulseaudio] 01/02: patch: try finding out binary name using dladdr
Felipe Sateler
fsateler at moszumanska.debian.org
Sun Aug 17 17:45:11 UTC 2014
This is an automated email from the git hooks/post-receive script.
fsateler pushed a commit to branch enable-tests
in repository pulseaudio.
commit 19f240535d923223b135847eaf772f3ad569b2f9
Author: Felipe Sateler <fsateler at debian.org>
Date: Sun Aug 17 13:40:54 2014 -0400
patch: try finding out binary name using dladdr
---
debian/changelog | 6 +++
debian/patches/series | 1 +
...finding-out-application-name-using-dladdr.patch | 63 ++++++++++++++++++++++
3 files changed, 70 insertions(+)
diff --git a/debian/changelog b/debian/changelog
index e6fa222..d27ebd4 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+pulseaudio (5.0-10) UNRELEASED; urgency=medium
+
+ * patch: try finding out binary name using dladdr
+
+ -- Felipe Sateler <fsateler at debian.org> Sun, 17 Aug 2014 13:40:44 -0400
+
pulseaudio (5.0-9) experimental; urgency=medium
* More patches from upstream for kFreeBSD
diff --git a/debian/patches/series b/debian/patches/series
index 621fd66..ed81a56 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -13,3 +13,4 @@ endianmacros-Fix-PA_MAYBE_INT16_SWAP-macro.patch
tests-Fix-mix-test-on-big-endian-systems.patch
util-Fix-pa_get_binary_name-on-Debian-kFreeBSD.patch
misc-cleanups-and-bug-fixes.patch
+util-Try-finding-out-application-name-using-dladdr.patch
diff --git a/debian/patches/util-Try-finding-out-application-name-using-dladdr.patch b/debian/patches/util-Try-finding-out-application-name-using-dladdr.patch
new file mode 100644
index 0000000..36c37b6
--- /dev/null
+++ b/debian/patches/util-Try-finding-out-application-name-using-dladdr.patch
@@ -0,0 +1,63 @@
+From 139358150c8ba7f40d9412147d6ee0824005fc4b Mon Sep 17 00:00:00 2001
+From: Felipe Sateler <fsateler at debian.org>
+Date: Thu, 14 Aug 2014 00:43:00 -0400
+Subject: [PATCH] util: Try finding out application name using dladdr if
+ available
+
+---
+ configure.ac | 2 ++
+ src/pulse/util.c | 18 ++++++++++++++++++
+ 2 files changed, 20 insertions(+)
+
+--- a/configure.ac
++++ b/configure.ac
+@@ -574,6 +574,8 @@ AC_SYS_LARGEFILE
+ # Check for open64 to know if the current system does have open64() and similar functions
+ AC_CHECK_FUNCS_ONCE([open64])
+
++AC_SEARCH_LIBS([dladdr], [dl], [HAVE_DLADDR=1], [HAVE_DLADDR=0])
++AC_DEFINE(HAVE_DLADDR, [1], [Have dladdr?])
+
+ ###################################
+ # External libraries #
+--- a/src/pulse/util.c
++++ b/src/pulse/util.c
+@@ -32,6 +32,7 @@
+ #include <time.h>
+ #include <unistd.h>
+ #include <sys/types.h>
++#include <dlfcn.h>
+
+ #ifdef HAVE_PWD_H
+ #include <pwd.h>
+@@ -64,6 +65,10 @@
+
+ #include "util.h"
+
++#ifdef HAVE_DLADDR
++extern int main(int, char*[]);
++#endif
++
+ char *pa_get_user_name(char *s, size_t l) {
+ const char *p;
+ char *name = NULL;
+@@ -205,6 +210,19 @@ char *pa_get_binary_name(char *s, size_t
+ }
+ }
+ #endif
++
++#ifdef HAVE_DLADDR
++ {
++ Dl_info DLInfo;
++ int err = dladdr(&main, &DLInfo);
++ if (err != 0) {
++ char *p = pa_realpath(DLInfo.dli_fname);
++ if (p) {
++ return p;
++ }
++ }
++ }
++#endif
+
+ #if defined(HAVE_SYS_PRCTL_H) && defined(PR_GET_NAME)
+ {
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-pulseaudio/pulseaudio.git
More information about the pkg-pulseaudio-devel
mailing list