Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 31 May 2015 16:12:18 +0000 (UTC)
From:      Koop Mast <kwm@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r388121 - in head/audio/pulseaudio: . files
Message-ID:  <201505311612.t4VGCIXB033668@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kwm
Date: Sun May 31 16:12:17 2015
New Revision: 388121
URL: https://svnweb.freebsd.org/changeset/ports/388121

Log:
  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

Added:
  head/audio/pulseaudio/files/patch-src_pulse_util.c   (contents, props changed)
Modified:
  head/audio/pulseaudio/Makefile

Modified: head/audio/pulseaudio/Makefile
==============================================================================
--- head/audio/pulseaudio/Makefile	Sun May 31 16:10:35 2015	(r388120)
+++ head/audio/pulseaudio/Makefile	Sun May 31 16:12:17 2015	(r388121)
@@ -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:

Added: head/audio/pulseaudio/files/patch-src_pulse_util.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/audio/pulseaudio/files/patch-src_pulse_util.c	Sun May 31 16:12:17 2015	(r388121)
@@ -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
+ 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201505311612.t4VGCIXB033668>