gnome-power-manager: prevent multiple processes in gdm



>From 9a502c530e43ab50be9e4f53e9e73f3f5fc510b0 Mon Sep 17 00:00:00 2001
From: Richard Hughes <richard hughsie com>
Date: Fri, 1 Apr 2011 17:46:29 +0100
Subject: [PATCH] If we loose the DBus name, exit

This prevents two instances of gnome-power-manager being run by gdm, which
itself causes an issue if the user closes the laptop lid, and both processes
tell upower to suspend.

One call to upower succeeds, and one fails, and the user is left with a
erroneous 'Your computer failed to suspend' message on resume.

In 3.2, gnome-power-manager is being moved to gnome-settings-daemon, and so the
problem goes away for good. Yay.
---
 src/gpm-manager.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/src/gpm-manager.c b/src/gpm-manager.c
index 0c79aa6..aa9f5cb 100644
--- a/src/gpm-manager.c
+++ b/src/gpm-manager.c
@@ -2262,6 +2262,7 @@ gpm_manager_name_lost_cb (GDBusConnection *connection,
 			  gpointer user_data)
 {
 	g_warning ("name lost %s", name);
+	exit (1);
 }

 /**
-- 
1.7.4.2


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]