X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fcgroup.c;h=c1ea95ab5600f7ace47b6db1cb3c7c8dd54971d8;hb=f1e36d677ac771408e40c34ead368a7fdbcc0622;hp=23ba5d86a9eb84d1278eff582eaf6a4889315986;hpb=e364ad0628b5930a671ae5be863b960f4bd748a8;p=elogind.git diff --git a/src/cgroup.c b/src/cgroup.c index 23ba5d86a..c1ea95ab5 100644 --- a/src/cgroup.c +++ b/src/cgroup.c @@ -1,4 +1,4 @@ -/*-*- Mode: C; c-basic-offset: 8 -*-*/ +/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ /*** This file is part of systemd. @@ -335,6 +335,21 @@ Unit* cgroup_unit_by_pid(Manager *m, pid_t pid) { return NULL; l = hashmap_get(m->cgroup_bondings, group); + + if (!l) { + char *slash; + + while ((slash = strrchr(group, '/'))) { + if (slash == group) + break; + + *slash = 0; + + if ((l = hashmap_get(m->cgroup_bondings, group))) + break; + } + } + free(group); LIST_FOREACH(by_path, b, l) {