blob: 3183f11ece086fd976b0013efe37582884babeed [file] [log] [blame]
From: Romain Perier <mrpouet@gentoo.org>
Date: Sat, 24 Oct 2009 18:43:43 +0200
Subject: [PATCH] Be able to shutdown or reboot even without polkit or RBAC supports
Ck does NOTHING at the origin if its built without polkit or RBAC supports, except
display a warning using g_warning() (which does not make sense).
The trick is to to call do_stop()/do_restart() in the #else directive :)
---
src/ck-manager.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/src/ck-manager.c b/src/ck-manager.c
index 99693a3..181df0d 100644
--- a/src/ck-manager.c
+++ b/src/ck-manager.c
@@ -1129,6 +1129,7 @@ ck_manager_restart (CkManager *manager,
check_rbac_permissions (manager, context, do_restart);
#else
g_warning ("Compiled without PolicyKit or RBAC support!");
+ do_restart(manager, context);
#endif
return TRUE;
@@ -1200,6 +1201,7 @@ ck_manager_stop (CkManager *manager,
check_rbac_permissions (manager, context, do_stop);
#else
g_warning ("Compiled without PolicyKit or RBAC support!");
+ do_stop(manager, context);
#endif
return TRUE;
--
1.6.5.1