X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fshared%2Fcgroup-util.c;h=05c3125aec79ca0ba2fafb2c27eb94ec65ccc085;hb=587fec427c80b6c34dcf1d7570f891fcb652a7c5;hp=b527868e6bd1e3802ee680a66b9753826d1be54e;hpb=63c372cb9df3bee01e3bf8cd7f96f336bddda846;p=elogind.git diff --git a/src/shared/cgroup-util.c b/src/shared/cgroup-util.c index b527868e6..05c3125ae 100644 --- a/src/shared/cgroup-util.c +++ b/src/shared/cgroup-util.c @@ -30,12 +30,10 @@ #include #include "cgroup-util.h" -#include "log.h" #include "set.h" #include "macro.h" #include "util.h" #include "path-util.h" -#include "strv.h" #include "unit-name.h" #include "fileio.h" #include "special.h" @@ -1251,17 +1249,15 @@ int cg_path_get_user_unit(const char *path, char **unit) { /* Skip slices, if there are any */ e = skip_slices(path); - /* Skip the session scope... */ + /* Skip the session scope or user manager... */ t = skip_session(e); - if (t) - /* ... and skip more slices if there's one */ - e = skip_slices(t); - else { - /* ... or require a user manager unit to be there */ - e = skip_user_manager(e); - if (!e) - return -ENOENT; - } + if (!t) + t = skip_user_manager(e); + if (!t) + return -ENOENT; + + /* ... and skip more slices if there are any */ + e = skip_slices(t); return cg_path_decode_unit(e, unit); }