aboutsummaryrefslogtreecommitdiffstats
path: root/audio/pulseaudio
diff options
context:
space:
mode:
authorkwm <kwm@FreeBSD.org>2015-06-01 00:12:17 +0800
committerkwm <kwm@FreeBSD.org>2015-06-01 00:12:17 +0800
commitb175bd1e6e35aa3c831fc65455c7f9b16e4aea12 (patch)
treea2efd45edf26768a6a0a49b18e588c602f6ffe79 /audio/pulseaudio
parent6c6a3c6b144c8657b49191f368b9c6c23bda7c95 (diff)
downloadfreebsd-ports-gnome-b175bd1e6e35aa3c831fc65455c7f9b16e4aea12.tar.gz
freebsd-ports-gnome-b175bd1e6e35aa3c831fc65455c7f9b16e4aea12.tar.zst
freebsd-ports-gnome-b175bd1e6e35aa3c831fc65455c7f9b16e4aea12.zip
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
Diffstat (limited to 'audio/pulseaudio')
-rw-r--r--audio/pulseaudio/Makefile2
-rw-r--r--audio/pulseaudio/files/patch-src_pulse_util.c35
2 files changed, 37 insertions, 0 deletions
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 <time.h>
+ #include <unistd.h>
+ #include <sys/types.h>
++#ifdef __FreeBSD__
++#include <sys/sysctl.h>
++#include <sys/user.h>
++#endif
+
+ #ifdef HAVE_PWD_H
+ #include <pwd.h>
+@@ -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
+