summaryrefslogtreecommitdiff
path: root/src/basic
diff options
context:
space:
mode:
Diffstat (limited to 'src/basic')
-rw-r--r--src/basic/cgroup-util.c13
-rw-r--r--src/basic/cgroup-util.h4
2 files changed, 12 insertions, 5 deletions
diff --git a/src/basic/cgroup-util.c b/src/basic/cgroup-util.c
index d909e2990..41a33899f 100644
--- a/src/basic/cgroup-util.c
+++ b/src/basic/cgroup-util.c
@@ -1936,19 +1936,29 @@ int cg_pid_get_slice(pid_t pid, char **slice) {
return cg_path_get_slice(cgroup, slice);
}
-#if 0 /// UNNEEDED by elogind
int cg_path_get_user_slice(const char *p, char **slice) {
+#if 0 /// UNNEEDED by elogind
const char *t;
+#endif // 0
assert(p);
assert(slice);
+#if 0 // nothing to skip in elogind
t = skip_user_prefix(p);
if (!t)
return -ENXIO;
+#endif // 0
+#if 0 /// UNNEEDED by elogind
/* And now it looks pretty much the same as for a system
* slice, so let's just use the same parser from here on. */
return cg_path_get_slice(t, slice);
+#else
+ /* In elogind there is nothing to skip, we can use the path
+ * directly. Generally speaking this is always a session id
+ * to user mapping. */
+ return cg_path_get_slice(p, slice);
+#endif // 0
}
int cg_pid_get_user_slice(pid_t pid, char **slice) {
@@ -1963,7 +1973,6 @@ int cg_pid_get_user_slice(pid_t pid, char **slice) {
return cg_path_get_user_slice(cgroup, slice);
}
-#endif // 0
char *cg_escape(const char *p) {
bool need_prefix = false;
diff --git a/src/basic/cgroup-util.h b/src/basic/cgroup-util.h
index 419d5f4bd..8bf232c13 100644
--- a/src/basic/cgroup-util.h
+++ b/src/basic/cgroup-util.h
@@ -213,9 +213,7 @@ int cg_path_get_user_unit(const char *path, char **unit);
int cg_path_get_machine_name(const char *path, char **machine);
#endif // 0
int cg_path_get_slice(const char *path, char **slice);
-#if 0 /// UNNEEDED by elogind
int cg_path_get_user_slice(const char *path, char **slice);
-#endif // 0
int cg_shift_path(const char *cgroup, const char *cached_root, const char **shifted);
int cg_pid_get_path_shifted(pid_t pid, const char *cached_root, char **cgroup);
@@ -228,9 +226,9 @@ int cg_pid_get_user_unit(pid_t pid, char **unit);
int cg_pid_get_machine_name(pid_t pid, char **machine);
#endif // 0
int cg_pid_get_slice(pid_t pid, char **slice);
-#if 0 /// UNNEEDED by elogind
int cg_pid_get_user_slice(pid_t pid, char **slice);
+#if 0 /// UNNEEDED by elogind
int cg_path_decode_unit(const char *cgroup, char **unit);
#endif // 0