~ubuntu-core-dev/update-notifier/ubuntu

« back to all changes in this revision

Viewing changes to src/reboot.c

  • Committer: Lionel Le Folgoc
  • Date: 2011-02-12 13:13:28 UTC
  • Revision ID: mrpouit@ubuntu.com-20110212131328-pmus51csprnso0oa
src/reboot.c: use consolekit instead of hal when gnome-session is
not available. lp: #716905

Show diffs side-by-side

added added

removed removed

Lines of Context:
78
78
}
79
79
 
80
80
static gboolean
81
 
hal_action_reboot()
 
81
ck_action_reboot()
82
82
{
83
83
   DBusGConnection *connection;
84
84
   GError *error;
92
92
   }
93
93
 
94
94
  proxy = dbus_g_proxy_new_for_name (connection,
95
 
                                     "org.freedesktop.Hal",
96
 
                                     "/org/freedesktop/Hal/devices/computer",
97
 
                                     "org.freedesktop.Hal.Device.SystemPowerManagement");
 
95
                                     "org.freedesktop.ConsoleKit",
 
96
                                     "/org/freedesktop/ConsoleKit/Manager",
 
97
                                     "org.freedesktop.ConsoleKit.Manager");
98
98
  if (proxy == NULL)
99
99
     return FALSE;
100
100
 
101
101
  error = NULL;
102
 
  if (!dbus_g_proxy_call (proxy, "Reboot", &error,
 
102
  if (!dbus_g_proxy_call (proxy, "Restart", &error,
103
103
                          G_TYPE_INVALID, G_TYPE_INVALID)) {
104
104
     g_error_free (error);
105
105
     return FALSE;
111
111
static void
112
112
request_reboot (void)
113
113
{
114
 
   if(!gdm_action_reboot() && !hal_action_reboot()) {
 
114
   if(!gdm_action_reboot() && !ck_action_reboot()) {
115
115
      const char *fmt, *msg, *details;
116
116
      fmt = "<span weight=\"bold\" size=\"larger\">%s</span>\n\n%s\n";
117
117
      msg = _("Reboot failed");