From b175bd1e6e35aa3c831fc65455c7f9b16e4aea12 Mon Sep 17 00:00:00 2001 From: kwm Date: Sun, 31 May 2015 16:12:17 +0000 Subject: Fix a segfault by using some FreeBSD sysctl to get the info needed. This can happen when /proc isn't mounted. While here, teach where the dbus machine-id file lives. > Description of fields to fill in above: 76 columns --| > PR: If a GNATS PR is affected by the change. > Differential Revision: https://reviews.freebsd.org/D### (*full* phabric URL needed). > Submitted by: If someone else sent in the change. > Reviewed by: If someone else reviewed your modification. > Approved by: If you needed approval for this commit. > Obtained from: If the change is from a third party. > MFC after: N [day[s]|week[s]|month[s]]. Request a reminder email. > MFH: Ports tree branch name. Request approval for merge. > Relnotes: Set to 'yes' for mention in release notes. > Security: Vulnerability reference (one per line) or description. > Sponsored by: If the change was sponsored by an organization. > Empty fields above will be automatically removed. M pulseaudio/Makefile AM pulseaudio/files/patch-src_pulse_util.c --- audio/pulseaudio/Makefile | 2 ++ audio/pulseaudio/files/patch-src_pulse_util.c | 35 +++++++++++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 audio/pulseaudio/files/patch-src_pulse_util.c (limited to 'audio/pulseaudio') diff --git a/audio/pulseaudio/Makefile b/audio/pulseaudio/Makefile index a7a630bcb9b5..1f4109283f5e 100644 --- a/audio/pulseaudio/Makefile +++ b/audio/pulseaudio/Makefile @@ -6,6 +6,7 @@ PORTNAME= pulseaudio PORTVERSION= 6.0 +PORTREVISION= 1 CATEGORIES= audio MASTER_SITES= http://freedesktop.org/software/pulseaudio/releases/ @@ -84,6 +85,7 @@ post-patch: @${REINPLACE_CMD} -e 's|%%LOCALBASE%%|${LOCALBASE}|g' \ ${WRKSRC}/src/daemon/default.pa.in @${REINPLACE_CMD} -e 's|-Wmissing-include-dirs||g' \ + -e 's|/lib/dbus/machine-id|/db/dbus/machine-id|g' \ ${WRKSRC}/configure post-install: diff --git a/audio/pulseaudio/files/patch-src_pulse_util.c b/audio/pulseaudio/files/patch-src_pulse_util.c new file mode 100644 index 000000000000..3d8481e0491a --- /dev/null +++ b/audio/pulseaudio/files/patch-src_pulse_util.c @@ -0,0 +1,35 @@ +--- src/pulse/util.c.orig 2015-02-12 15:10:35.000000000 +0100 ++++ src/pulse/util.c 2015-05-31 17:50:08.221242000 +0200 +@@ -30,6 +30,10 @@ + #include + #include + #include ++#ifdef __FreeBSD__ ++#include ++#include ++#endif + + #ifdef HAVE_PWD_H + #include +@@ -215,13 +219,14 @@ char *pa_get_binary_name(char *s, size_t + + #ifdef __FreeBSD__ + { +- char *rp; +- +- if ((rp = pa_readlink("/proc/curproc/file"))) { +- pa_strlcpy(s, pa_path_get_filename(rp), l); +- pa_xfree(rp); +- return s; +- } ++ int mib[] = { CTL_KERN, KERN_PROC, KERN_PROC_PID, getpid()}; ++ struct kinfo_proc kp; ++ size_t sz = sizeof(kp); ++ ++ if (sysctl(mib, 4, &kp, &sz, NULL, 0) == 0) ++ return kp.ki_comm; ++ else ++ return NULL; + } + #endif + -- cgit