$NetBSD: patch-ab,v 1.2 2008/12/18 15:56:13 jmcneill Exp $

--- plugins/sound/gsd-sound-manager.c.orig	2008-11-24 18:02:41.000000000 -0500
+++ plugins/sound/gsd-sound-manager.c
@@ -21,6 +21,7 @@
 
 #include "config.h"
 
+#include <sys/stat.h>
 #include <sys/types.h>
 #include <sys/wait.h>
 #include <stdlib.h>
@@ -28,6 +29,7 @@
 #include <unistd.h>
 #include <string.h>
 #include <errno.h>
+#include <signal.h>
 
 #include <locale.h>
 
@@ -97,16 +99,24 @@ reset_esd_pid (GPid             pid,
 static gboolean
 start_gnome_sound (GsdSoundManager *manager)
 {
-        char    *argv[] = { ESD_LOCATION  "esd", "-nobeeps", NULL};
+        char    **argv;
+	char	*argv_esd[] = { ESD_LOCATION  "esd", "-nobeeps", NULL};
+	char	*argv_esdcompat[] = { ESD_LOCATION  "esdcompat", "-nobeeps", NULL};
         GError  *error;
         gboolean res;
         time_t   starttime;
         gboolean ret;
+	struct stat st;
 
         ret = FALSE;
 
         gnome_settings_profile_start (NULL);
 
+	if (stat (argv_esdcompat[0], &st) == 0)
+		argv = argv_esdcompat;
+	else
+		argv = argv_esd;
+
         error = NULL;
         res = g_spawn_async (NULL,
                              argv,
