only start esd if not running.
2006-02-06 Rodrigo Moya <rodrigo@novell.com> * gnome-settings-sound.c (start_esd): only start esd if not running.
This commit is contained in:
parent
98d6c3d686
commit
b4622dda5d
2 changed files with 20 additions and 11 deletions
|
@ -1,3 +1,7 @@
|
|||
2006-02-06 Rodrigo Moya <rodrigo@novell.com>
|
||||
|
||||
* gnome-settings-sound.c (start_esd): only start esd if not running.
|
||||
|
||||
2006-01-30 Rodrigo Moya <rodrigo@novell.com>
|
||||
|
||||
* gnome-settings-multimedia-keys.c: reverted commit from 2006-01-11.
|
||||
|
|
|
@ -55,22 +55,27 @@ start_esd (void)
|
|||
char *tmpargv[3];
|
||||
char argbuf[32];
|
||||
time_t starttime;
|
||||
GnomeClient *client = gnome_master_client ();
|
||||
|
||||
esdpid = gnome_execute_async (NULL, 2, (char **)esd_cmdline);
|
||||
g_snprintf (argbuf, sizeof (argbuf), "%d", esdpid);
|
||||
tmpargv[0] = "kill"; tmpargv[1] = argbuf; tmpargv[2] = NULL;
|
||||
gnome_client_set_shutdown_command (client, 2, tmpargv);
|
||||
starttime = time (NULL);
|
||||
gnome_sound_init (NULL);
|
||||
|
||||
while (gnome_sound_connection_get () < 0
|
||||
&& ((time(NULL) - starttime) < 4))
|
||||
if (gnome_sound_connection_get () < 0)
|
||||
{
|
||||
GnomeClient *client = gnome_master_client ();
|
||||
|
||||
esdpid = gnome_execute_async (NULL, 2, (char **)esd_cmdline);
|
||||
g_snprintf (argbuf, sizeof (argbuf), "%d", esdpid);
|
||||
tmpargv[0] = "kill"; tmpargv[1] = argbuf; tmpargv[2] = NULL;
|
||||
gnome_client_set_shutdown_command (client, 2, tmpargv);
|
||||
starttime = time (NULL);
|
||||
gnome_sound_init (NULL);
|
||||
|
||||
while (gnome_sound_connection_get () < 0
|
||||
&& ((time(NULL) - starttime) < 4))
|
||||
{
|
||||
#ifdef HAVE_USLEEP
|
||||
usleep(1000);
|
||||
usleep(1000);
|
||||
#endif
|
||||
gnome_sound_init(NULL);
|
||||
gnome_sound_init(NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue