Sophie

Sophie

distrib > Mandriva > 2008.1 > i586 > media > main-release-src > by-pkgid > 5a95a25af2dd93cff676a7787a248cfa > files > 5

pulseaudio-0.9.9-7mdv2008.1.src.rpm

Index: src/daemon/esdcompat.in
===================================================================
--- src/daemon/esdcompat.in	(revision 2082)
+++ src/daemon/esdcompat.in	(working copy)
@@ -26,8 +26,37 @@
     exit 1
 }
 
-ARGS=" --log-target=syslog"
+# Start Mandriva customisation
+if [ -r ~/.pulserc ]; then
+  CONFIG=~/.pulserc
+else
+  CONFIG=/etc/sysconfig/pulseaudio
+fi
 
+PULSE_ARGS="--log-target=syslog"
+[ -r "$CONFIG" ] && . $CONFIG
+
+if [ "$PULSE_SERVER_TYPE" != "personal" ]; then
+  echo "Not starting PulseAudio daemon due to sysconfig setting." >&2
+  exit
+fi
+
+# Do some pid file tidy up
+PIDFILE=/tmp/pulse-$USER/pid
+if [ -f $PIDFILE ]; then
+  PID=$(cat $PIDFILE)
+  if [ -f /proc/$PID/status ]; then
+    PNAME=$(cat /proc/$PID/status | grep ^Name | awk '{ print $2 }')
+    if [ "pulseaudio" != "$PNAME" ]; then
+      # This is a bogus pid file and pulse will fail to start.
+      rm -f $PIDFILE
+    fi
+  fi
+fi
+
+ARGS=" $PULSE_ARGS"
+# End Mandriva customisation
+
 while [ "$#" -gt "0" ]; do
 
     case "$1" in