chiark / gitweb /
Prep v231.2: Minor changes to make future patching easier.
authorSven Eden <yamakuzure@gmx.net>
Wed, 28 Jun 2017 08:48:10 +0000 (10:48 +0200)
committerSven Eden <yamakuzure@gmx.net>
Wed, 28 Jun 2017 08:48:10 +0000 (10:48 +0200)
src/login/logind-action.c
src/login/logind-user.c
src/update-utmp/update-utmp.c

index 82c061d..bcf7b86 100644 (file)
@@ -111,12 +111,21 @@ int manager_handle_action(
                 return 1;
         }
 
+#if 0 /// elogind needs its own can_sleep() variant.
+        if (handle == HANDLE_SUSPEND)
+                supported = can_sleep("suspend") > 0;
+        else if (handle == HANDLE_HIBERNATE)
+                supported = can_sleep("hibernate") > 0;
+        else if (handle == HANDLE_HYBRID_SLEEP)
+                supported = can_sleep("hybrid-sleep") > 0;
+#else
         if (handle == HANDLE_SUSPEND)
                 supported = can_sleep(m, "suspend") > 0;
         else if (handle == HANDLE_HIBERNATE)
                 supported = can_sleep(m, "hibernate") > 0;
         else if (handle == HANDLE_HYBRID_SLEEP)
                 supported = can_sleep(m, "hybrid-sleep") > 0;
+#endif // 0
         else if (handle == HANDLE_KEXEC)
                 supported = access(KEXEC, X_OK) >= 0;
         else
index f24dd61..171a4a6 100644 (file)
 #include "user-util.h"
 #include "util.h"
 
+#if 1 /// elogind uses a static value here
+#  define SPECIAL_USER_SLICE "user.slice"
+#endif // 1
+
 int user_new(User **out, Manager *m, uid_t uid, gid_t gid, const char *name) {
         _cleanup_(user_freep) User *u = NULL;
         char lu[DECIMAL_STR_MAX(uid_t) + 1];
@@ -77,7 +81,7 @@ int user_new(User **out, Manager *m, uid_t uid, gid_t gid, const char *name) {
         if (asprintf(&u->runtime_path, "/run/user/"UID_FMT, uid) < 0)
                 return -ENOMEM;
 
-        r = slice_build_subslice("user.slice", lu, &u->slice);
+        r = slice_build_subslice(SPECIAL_USER_SLICE, lu, &u->slice);
         if (r < 0)
                 return r;
 
index af16657..9f02172 100644 (file)
@@ -69,6 +69,7 @@ static usec_t get_startup_time(Context *c) {
                 log_error_errno(r, "Failed to get timestamp: %s", bus_error_message(&error, r));
                 return 0;
         }
+
         return t;
 }