chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
shared/util: drop duplicate log2u64 function
[elogind.git]
/
src
/
shared
/
cgroup-util.c
diff --git
a/src/shared/cgroup-util.c
b/src/shared/cgroup-util.c
index b527868e6bd1e3802ee680a66b9753826d1be54e..dfd8689b72a88a5e58ce6049d8c9ee09abd564d1 100644
(file)
--- a/
src/shared/cgroup-util.c
+++ b/
src/shared/cgroup-util.c
@@
-1251,17
+1251,15
@@
int cg_path_get_user_unit(const char *path, char **unit) {
/* Skip slices, if there are any */
e = skip_slices(path);
/* 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);
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);
}
return cg_path_decode_unit(e, unit);
}