Merge lp:~superm1/update-notifier/hal-fallback into lp:update-notifier/ubuntu

Proposed by Mario Limonciello
Status: Merged
Merged at revision: not available
Proposed branch: lp:~superm1/update-notifier/hal-fallback
Merge into: lp:update-notifier/ubuntu
Diff against target: 61 lines
2 files modified
debian/changelog (+7/-0)
src/reboot.c (+32/-1)
To merge this branch: bzr merge lp:~superm1/update-notifier/hal-fallback
Reviewer Review Type Date Requested Status
Michael Vogt (community) Approve
Ubuntu Core Development Team Pending
Review via email: mp+12971@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Michael Vogt (mvo) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2009-09-10 16:45:28 +0000
3+++ debian/changelog 2009-10-07 07:40:25 +0000
4@@ -1,3 +1,10 @@
5+update-notifier (0.89) UNRELEASED; urgency=low
6+
7+ * src/reboot.c:
8+ - Fallback to HAL if possible to reboot.
9+
10+ -- Mario Limonciello <superm1@ubuntu.com> Wed, 07 Oct 2009 01:56:12 -0500
11+
12 update-notifier (0.88) karmic; urgency=low
13
14 * ui/reboot-dialog.ui:
15
16=== modified file 'src/reboot.c'
17--- src/reboot.c 2009-07-07 18:45:47 +0000
18+++ src/reboot.c 2009-10-07 07:40:25 +0000
19@@ -76,10 +76,41 @@
20 return TRUE;
21 }
22
23+static gboolean
24+hal_action_reboot()
25+{
26+ DBusGConnection *connection;
27+ GError *error;
28+ DBusGProxy *proxy;
29+
30+ error = NULL;
31+ connection = dbus_g_bus_get (DBUS_BUS_SYSTEM, &error);
32+ if (connection == NULL) {
33+ g_error_free (error);
34+ return FALSE;
35+ }
36+
37+ proxy = dbus_g_proxy_new_for_name (connection,
38+ "org.freedesktop.Hal",
39+ "/org/freedesktop/Hal/devices/computer",
40+ "org.freedesktop.Hal.Device.SystemPowerManagement");
41+ if (proxy == NULL)
42+ return FALSE;
43+
44+ error = NULL;
45+ if (!dbus_g_proxy_call (proxy, "Reboot", &error,
46+ G_TYPE_INVALID, G_TYPE_INVALID)) {
47+ g_error_free (error);
48+ return FALSE;
49+ }
50+ return TRUE;
51+
52+}
53+
54 static void
55 request_reboot (void)
56 {
57- if(!gdm_action_reboot()) {
58+ if(!gdm_action_reboot() && !hal_action_reboot()) {
59 const char *fmt, *msg, *details;
60 fmt = "<span weight=\"bold\" size=\"larger\">%s</span>\n\n%s\n";
61 msg = _("Reboot failed");

Subscribers

People subscribed via source and target branches

to all changes: