[systemd-commits] 3 commits - Makefile.am src/login src/sleep

Lennart Poettering lennart at kemper.freedesktop.org
Fri Jun 1 06:58:30 PDT 2012


 Makefile.am             |    1 +
 src/login/logind-dbus.c |   16 +++++++++-------
 src/sleep/sleep.c       |    4 ++--
 3 files changed, 12 insertions(+), 9 deletions(-)

New commits:
commit d5a745df4da6265e32db667807b4f7214cac95f0
Author: Lennart Poettering <lennart at poettering.net>
Date:   Fri Jun 1 15:57:21 2012 +0200

    logind: fix indentation

diff --git a/src/login/logind-dbus.c b/src/login/logind-dbus.c
index f4b232b..17bd5e5 100644
--- a/src/login/logind-dbus.c
+++ b/src/login/logind-dbus.c
@@ -1088,11 +1088,11 @@ static int bus_manager_can_shutdown_or_sleep(
 
                 if (r > 0)
                         result = "yes";
-                        else if (challenge)
-                                result = "challenge";
-                        else
-                                result = "no";
-                }
+                else if (challenge)
+                        result = "challenge";
+                else
+                        result = "no";
+        }
 
         if (blocked) {
                 r = verify_polkit(connection, message, action_ignore_inhibit, false, &challenge, error);

commit 398f7c881b90d2ca4edafcb60dba3822eb9f73eb
Author: Matthias Clasen <mclasen at redhat.com>
Date:   Thu May 31 21:50:23 2012 -0400

    logind: interpret the can_sleep return value properly
    
    can_sleep() returns a boolean, so a return value > 0 does not
    mean 'na'.

diff --git a/src/login/logind-dbus.c b/src/login/logind-dbus.c
index 6175d57..f4b232b 100644
--- a/src/login/logind-dbus.c
+++ b/src/login/logind-dbus.c
@@ -1068,8 +1068,10 @@ static int bus_manager_can_shutdown_or_sleep(
                 if (r < 0)
                         return r;
 
-                result = "na";
-                goto finish;
+                if (r == 0) {
+                        result = "na";
+                        goto finish;
+                }
         }
 
         r = have_multiple_sessions(connection, m, message, error);

commit ddcbc8737873ca1904562d7d3ca3de9946e2f889
Author: Matthias Clasen <mclasen at redhat.com>
Date:   Thu May 31 20:07:12 2012 -0400

    sleep: Don't call execute_directory() on a binary
    
    Probably a copy-paste error, SYSTEMD_SLEEP_BINARY_PATH should
    have been SYSTEMD_SLEEP_PATH.

diff --git a/Makefile.am b/Makefile.am
index 833f72a..15f7a34 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -129,6 +129,7 @@ AM_CPPFLAGS = \
 	-DSYSTEM_GENERATOR_PATH=\"$(systemgeneratordir)\" \
 	-DUSER_GENERATOR_PATH=\"$(usergeneratordir)\" \
 	-DSYSTEM_SHUTDOWN_PATH=\"$(systemshutdowndir)\" \
+	-DSYSTEM_SLEEP_PATH=\"$(systemsleepdir)\" \
 	-DSYSTEMD_KBD_MODEL_MAP=\"$(pkgdatadir)/kbd-model-map\" \
 	-DX_SERVER=\"$(bindir)/X\" \
 	-DUDEVLIBEXECDIR=\""$(libexecdir)/udev"\" \
diff --git a/src/sleep/sleep.c b/src/sleep/sleep.c
index 941edc3..c86f69c 100644
--- a/src/sleep/sleep.c
+++ b/src/sleep/sleep.c
@@ -63,7 +63,7 @@ int main(int argc, char *argv[]) {
         arguments[1] = (char*) "pre";
         arguments[2] = argv[1];
         arguments[3] = NULL;
-        execute_directory(SYSTEMD_SLEEP_BINARY_PATH, NULL, arguments);
+        execute_directory(SYSTEM_SLEEP_PATH, NULL, arguments);
 
         if (streq(argv[1], "suspend"))
                 log_info("Suspending system...");
@@ -82,7 +82,7 @@ int main(int argc, char *argv[]) {
                 log_info("System thawed.");
 
         arguments[1] = (char*) "post";
-        execute_directory(SYSTEMD_SLEEP_BINARY_PATH, NULL, arguments);
+        execute_directory(SYSTEM_SLEEP_PATH, NULL, arguments);
 
         fclose(f);
 



More information about the systemd-commits mailing list