summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSven Eden <yamakuzure@gmx.net>2017-06-28 10:48:10 +0200
committerSven Eden <yamakuzure@gmx.net>2017-06-28 10:48:10 +0200
commit36fcac2cf7efe0164cce7d7674b6d13ddb14bb4b (patch)
tree023b469d71d77eeb2e1fea4a74e783be634fb828 /src
parent3e6d9bb47a4f0f7b717de2691b1b962f65851869 (diff)
Prep v231.2: Minor changes to make future patching easier.
Diffstat (limited to 'src')
-rw-r--r--src/login/logind-action.c9
-rw-r--r--src/login/logind-user.c6
-rw-r--r--src/update-utmp/update-utmp.c1
3 files changed, 15 insertions, 1 deletions
diff --git a/src/login/logind-action.c b/src/login/logind-action.c
index 82c061d62..bcf7b86a3 100644
--- a/src/login/logind-action.c
+++ b/src/login/logind-action.c
@@ -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
diff --git a/src/login/logind-user.c b/src/login/logind-user.c
index f24dd618f..171a4a670 100644
--- a/src/login/logind-user.c
+++ b/src/login/logind-user.c
@@ -49,6 +49,10 @@
#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;
diff --git a/src/update-utmp/update-utmp.c b/src/update-utmp/update-utmp.c
index af1665733..9f0217250 100644
--- a/src/update-utmp/update-utmp.c
+++ b/src/update-utmp/update-utmp.c
@@ -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;
}